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
/* Simple JavaScript Inheritance | |
* By John Resig http://ejohn.org/blog/simple-javascript-inheritance/ | |
* MIT Licensed. | |
*/ | |
// Inspired by base2 and Prototype | |
(function(){ | |
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
// The base Class implementation (does nothing) | |
this.Class = function(){}; | |
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
[ | |
{ | |
"slug": "react-redux-the-single-immutable-state-tree", | |
"question": "What is the *entire* state of the application represented as?", | |
"answer": "A single Javascript object." | |
}, | |
{ | |
"slug": "react-redux-describing-state-changes-with-actions", | |
"question": "What is an action?", | |
"answer": "A minimally represented change of the state" |
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
aasm :column => :state do | |
state :proposed, :initial => true | |
state :cancelled | |
state :accepted | |
state :claimed | |
state :submitted | |
state :rejected | |
state :updated | |
state :approved | |
state :published |
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
import hype.*; | |
import hype.extended.colorist.HPixelColorist; | |
int myStageW = 1920; | |
int myStageH = 1080; | |
color clrBG = #FFFFFF; | |
// ******************************************************************************************************************** |
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.demos.imagegallery.base | |
{ | |
import flash.events.Event; | |
import flash.events.IEventDispatcher; | |
/** | |
* Provides some common functionality for basic application classes (models and services) | |
*/ | |
public class BaseActor | |
{ |
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
.run(function ($rootScope, $log, $window) { | |
var prepareLogFn = function (logFn) { | |
var enhancedLogFn = function () { | |
var modifiedArguments = Array.prototype.slice.call(arguments); | |
modifiedArguments[0] = [moment().format() + ' '] + modifiedArguments[0]; | |
logFn.apply(null, modifiedArguments); | |
}; | |
enhancedLogFn.logs = [ ]; |
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
$scope.subscriptions = _.map(_.sortBy(_.filter(subscriptions, function(sub) { | |
return sub.transactions && sub.transactions.length; | |
}), function(sub) { | |
return _.last(sub.transactions).created_at; | |
}), function(sub) { | |
var last_transaction = _.last(sub.transactions), | |
totals = _.reduce(sub.transactions, function (memo, t) { | |
return memo + t.amount/100.0; | |
}, 0); |
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
Run options: exclude {:org=>true} | |
......FFFF.FF.F | |
Failures: | |
1) Quarto::Build stripping source code should eq "puts \"hello, world\nif true\n puts \"goodbye, world\nend\n" | |
Failure/Error: expect(build.strip_listing(code)).to eq(<<END) | |
expected: "puts \"hello, world\nif true\n puts \"goodbye, world\nend\n" | |
got: "puts \"hello, world\n if true\n puts \"goodbye, world\n end" |
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
//from most to least verbose, but it is all the same in the end. | |
(function() { | |
var module = angular.module("myApp.myModel", []); | |
var MyModel = function MyModel() { | |
this.asyncService = null; | |
this.someApi = function() { |
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
module.directive('validatePhone', function () { | |
return { | |
require: 'ngModel', | |
link: function (scope, elem, attr, ngModel) { | |
function validatePhone(field) { | |
//regex squirreled from here: http://blog.stevenlevithan.com/archives/validate-phone-number | |
var regexObj = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/; | |
return regexObj.test(field); |