Welcome To Snipplr
Everyone's Recent Snippets Tagged object
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This technical tip shows how .NET developers can add line object to an Existing PDF File inside their .NET applications. Aspose.Pdf for .NET supports the feature to add graph objects (for example graph, line, rectangle etc.) to PDF documents. You als...
0
2023
posted 8 years ago by sherazam
Using underscore.js, you could combine .findWhere with .without
Although, since you are creating a new array in this case anyway, you could simply use _.filter or the native Array.prototype.filter function (just like shown in the other question)....
0
3908
posted 9 years ago by Balamir
To do this for any object in JavaScript will not be simple or straightforward. You will run into the problem of erroneously picking up attributes from the object's prototype that should be left in the prototype and not copied to the new instance. If,...
0
1251
posted 9 years ago by BrentS
A template for a javascript object with a object.create shiv to condense into object prototypes
0
977
posted 10 years ago by rickygri
This example of code allows you to create a new object in javascript (using simple inheritance) such that the class of the object is defined from a variable. After creating the object you may use it for your purposes.
0
929
posted 10 years ago by apphp-snippets
Very simple use of an non-animating spritesheet for iOS
0
1121
posted 10 years ago by sidneydekoning
From @blixt http://stackoverflow.com/users/119081/blixt
As you can see, the classes correctly interact with each other (they share the static id from MyClass, the announce method uses the correct get_name method, etc.)
One thing to note is the...
1
971
posted 10 years ago by rickygri
Aspose.PDF for Cloud API has released PHP SDK which allows PHP developers to convert PDF files uploaded to a remote server to other formats. You can pass URL and format parameters to specify the PDF’s URL and output format and use the PUT method of...
0
2446
posted 10 years ago by johansonkatherine
C#
C#/.NET Code Samples to Save Microsoft OneNote (.one) file as an image (.PNG, .BMP, .JPEG, .GIF) file
The Aspose.Note for .NET API allows developers to open files & manipulate elements of OneNote books & export them to PNG, GIF, JPEG, BMP and PDF formats. The following code sample shows developers how to save OneNote File as an image in C#/.NET
0
1900
posted 10 years ago by johansonkatherine
JavaScript
Template for a Javascript function with optional and mandatory arguments passed as an object collection
A simple template for a JavaScript function which allows for an arbitrary number of named arguments to be passed in. This is achieved by passing a single object as an argument with each of the 'real' arguments being a key/value pair. In this way argu...
0
1416
posted 12 years ago by davidwaterston
Any valid json object will be recursively traversed building a nested unordered list of its properties and their values. This example parses the json entered in the text area into an object that is passed to the json_tree() function. I use the twit...
0
1180
posted 12 years ago by halk
If you want to use this in a class, change the last line to:
` return array_map(array($this, __FUNCTION__), $object ); `
0
816
posted 12 years ago by jgomez
`Object.create(null)` is a more memory-efficient way to make objects, but it's not supported in all versions of JavaScript, so you can do the "old-fashioned" `{}` if that function isn't available.
0
917
posted 12 years ago by EvanHahn
Function to validate the existence of each key in the object to get the number of valid key/value pairs.
0
887
posted 12 years ago by reverend
A class i started to implement, which ended up in a working concept
However I'm not sure if it's a legal way of programming since I unnessesery
changes the structure of php without some real value except nicer structure
For now it remain a conce...
0
935
posted 13 years ago by Knarf
By not being limited to provide certain arguments/parameters in right order when calling a function, makes the function more versatile and easier to extend without breaking old code (e.g. calls to the function).
One solution is to pass an associati...
0
1044
posted 13 years ago by coprolit
an operator that implements true prototypal Object inheritance in JavaScript
0
815
posted 13 years ago by luizlopes
this function gets a parameter like an hex color (es: "#ffffff"), an abbreviated hex color (es: "#fff"), an rgb color (es: "rgb(255,255,255)") or an rgba color (es: "rgba(255,255,255,1)"), and returns an object containing the rgba values, like { red:...
0
2042
posted 13 years ago by claudiowebdesign
Used to sort array of objects by it's property
Note: Anonymous functions are available since PHP 5.3.0.
0
1212
posted 13 years ago by Rain
1. Get Posts however you see fit
2. Loop through the posts getting the terms from taxonomies and add them to the Post object
3. Sort the Array of Post Objects by the property you want them sorted by using sort_on_field()
0
1335
posted 13 years ago by kingkool68
I create this recursive function to remove and null all children inside a display object container.
0
1155
posted 13 years ago by radykal
Hey guys, I struggled a little to find a crossbrowser, non repetitive params way to embed swfs; this object embed works flawlessly for me in all browsers - ie7, ie8, safari, chrome, firefox. Why is swfobject and YouTube using this format - http://cod...
0
1085
posted 13 years ago by digitalzoomstudio
For this to work you need the as3corelib classes from here ... https://github.com/mikechambers/as3corelib
0
2848
posted 13 years ago by adrianparr