This file contains hidden or 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 changeValueForPath = function (obj, path) { | |
var key; | |
path = path ? path + "." : ""; | |
for (key in obj) { | |
if (Object.prototype.toString.call(obj[key]) === '[object Object]') { | |
obj[key] = doTheThing(obj[key], path + key); | |
} else { | |
obj[key] = path + key | |
} |
This file contains hidden or 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
window.require = | |
baseUrl: 'scripts' | |
paths: | |
jquery: '../bower_components/jquery/jquery' | |
'jquery-ui': '../bower_components/jquery-ui' | |
'ui.accordion': 'jquery-ui/ui/jquery.ui.accordion', | |
'ui.autocomplete': 'jquery-ui/ui/jquery.ui.autocomplete', | |
'ui.button': 'jquery-ui/ui/jquery.ui.button', | |
'ui.core': 'jquery-ui/ui/jquery.ui.core', |
This file contains hidden or 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
class MyCtrl | |
$inject: ['$scope', 'aService'] | |
constructor: (@$scope, @aService) -> | |
@aValue = 5 | |
someAwesomeFunction: (param1) => | |
@aService.someCall param1 | |
app.controller 'MyCtrl', MyCtrl |
This file contains hidden or 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
if (!($scope.$$phase || $rootScope.$$phase)) { | |
$scope.$digest(); | |
} |
This file contains hidden or 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 (word) { | |
word = word.split(''); | |
var combinations = [], max = factorial(word.length); | |
function factorial (number) { | |
if (number <= 1) return 1; | |
return factorial(number - 1) * number; | |
} | |
!function () { |
This file contains hidden or 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
Show hidden characters
{ | |
"folders": | |
[ | |
{ | |
"follow_symlinks": true, | |
"name": "Designs", | |
"path": "/path/to/repo/jcr_root/etc/designs" | |
}, | |
{ | |
"follow_symlinks": true, |
This file contains hidden or 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
// lib imports | |
import {ReplaySubject} from 'rxjs/ReplaySubject'; | |
// src imports | |
import {Reducer, IReducerAction, IReduceCases} from './reducer'; | |
export enum GateActions { | |
OPEN, | |
CLOSE, | |
TOGGLE | |
}; |
This file contains hidden or 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 () { | |
'use strict'; | |
function ConsumerController ($scope, Service) { | |
this.init = function () { | |
Service.subscribeToEventName($scope, function (e, data) { | |
// do something | |
}, this); | |
}; |
This file contains hidden or 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 {NgModule} from '@angular/core'; | |
import {Awesome} from './awesome.base'; | |
import {AwesomeServer} from './awesome.server'; | |
@NgModule({ | |
providers: [ | |
{provide: Awesome, useClass: AwesomeServer} | |
] | |
}) | |
export class App {} |
This file contains hidden or 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 { NgModule, Injectable } from '@angular/core'; | |
import { | |
Request, | |
Response, | |
XHRBackend, | |
JSONPBackend, | |
RequestMethod | |
} from '@angular/http'; | |
import { | |
NodeBackend, |