This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"base": { | |
"bluebird": "3.4.0", | |
"lodash": "4.5.0", | |
"microtime": "2.1.1", | |
"uuid": "2.0.1" | |
}, | |
"production": { | |
"pm2": "1.1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
var dest = { | |
foo : { | |
b1 : "b1 value", | |
b2 : "b2 value" | |
}, | |
baz : { | |
q1 : "q1 value" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package robotlegs.bender.extensions.migration{ | |
import org.swiftsuspenders.Injector; | |
import org.swiftsuspenders.dependencyproviders.DependencyProvider; | |
import robotlegs.bender.framework.api.IExtension; | |
import robotlegs.bender.framework.api.IInjector; | |
public class MapInjectorExtension implements IExtension{ | |
public function extend(context:IContext):void{ | |
const injector : IInjector = context.injector; | |
const injectorProvider: DependencyProvider = injector.getMapping(IInjector).getProvider(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (definition) { | |
/* | |
AMD/CommonJS compatibility largely stolen from https://github.com/kriskowal/q/blob/master/q.js | |
*/ | |
// Turn off strict mode for this function so we can assign to global | |
/*jshint strict: false, -W117*/ | |
// This file will function properly as a <script> tag, or a module | |
// using CommonJS and NodeJS or RequireJS module formats. In | |
// Common/Node/RequireJS, the module exports the API and when |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package passByReference | |
{ | |
/** | |
* @author creynder | |
*/ | |
public class PassByReference{ | |
public function PassByReference() | |
{ | |
var receiver : Receiver = new Receiver(); | |
trace( receiver.counter ); //outputs "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrayDuplicates | |
{ | |
import flash.utils.getTimer; | |
/** | |
* @author creynder | |
*/ | |
public class ArrayDuplicates{ | |
public function ArrayDuplicates() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arraySort | |
{ | |
import mx.utils.ObjectUtil; | |
public class ArraySort{ | |
public function run() : void{ | |
var i : int; | |
var n : int = 500; | |
var arr : Array = []; | |
for ( i = 0; i<n; i++ ){ | |
arr.push( { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- save to | |
Mac OS X: ~/Library/Preferences/{WebIdeXX}/codestyles | |
--> | |
<code_scheme name="keystone"> | |
<JSCodeStyleSettings> | |
<option name="INDENT_PACKAGE_CHILDREN" value="1" /> | |
<option name="SPACE_BEFORE_TYPE_COLON" value="true" /> | |
<option name="SPACE_AFTER_TYPE_COLON" value="true" /> | |
<option name="ALIGN_OBJECT_PROPERTIES" value="2" /> | |
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Obj = { | |
createProxy : function( o ) { | |
var F = function () { | |
}; | |
F.prototype = o; | |
return F; | |
}, | |
createObject : function( o ){ | |
//Crockford Object.create | |
var F = Obj.createProxy( o ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mymodule_pre_hook(){ | |
register_hook( 'mymodule_form_foo_node_form_alter', 'mymodule_handle_nodetype_form_alter' ); | |
register_hook( 'mymodule_form_baz_node_form_alter', 'mymodule_handle_nodetype_form_alter' ); | |
} | |
function mymodule_handle_nodetype_form_alter( &$form, &$form_state, $form_id ){ | |
//do what you need | |
} |
NewerOlder