Skip to content

Instantly share code, notes, and snippets.

View jimthedev's full-sized avatar

Jim Cummins jimthedev

View GitHub Profile
@jimthedev
jimthedev / dependencies
Created July 14, 2014 20:41
generator-ionic dependencies list for gulp branch
List of current dependencies as of July 14, 2014. On the left is the current dependency, on the right, the possible replacement:
"grunt": "~0.4.1", https://github.com/gulpjs/gulp/
"grunt-autoprefixer": "~0.4.0", https://github.com/Metrime/gulp-autoprefixer
"grunt-bower-install": "~0.7.0", https://github.com/taptapship/wiredep
"grunt-concurrent": "~0.4.1", Likely unneeded since gulp runs concurrent by default.
"grunt-contrib-clean": "~0.5.0", https://github.com/robrich/gulp-rimraf
"grunt-contrib-compass": "~0.6.0", https://github.com/appleboy/gulp-compass
"grunt-contrib-concat": "~0.3.0", https://github.com/wearefractal/gulp-concat
"grunt-contrib-connect": "~0.5.0", https://github.com/avevlad/gulp-connect
/* AngularDDP - a client for DDP version pre1 */
angular.module('angularDDP', ['$q'])
.factory("DDP", function (wsUri) {
function Constructor(wsUri) {
this.VERSIONS = ["pre1"];
this.wsUri = wsUri;
this.sock;
this.defs = {}; // { deferred_id => deferred_object }
@jimthedev
jimthedev / Error
Last active August 29, 2015 14:04 — forked from afuggini/Error
Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module starter.controllers due to:
Error: [$injector:modulerr] Failed to instantiate module angularDDP due to:
Error...<omitted>...1)
@jimthedev
jimthedev / gist:075681f56450b5e684f4
Created August 5, 2014 21:56
genericCollectionFactory.js
.factory('genericCollectionFactory',function(){
function Collection() {
var _items = [];
function get () {
return _items;
}
function add (item) {
@jimthedev
jimthedev / schema.json
Created September 8, 2014 15:38
schema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"shift": {
"$ref": "members-rest-api/schema/#/definitions/shift"
},
"blah": {
"test": "boolean"
}
}
@jimthedev
jimthedev / falcor-express-server-with-logging.js
Created August 20, 2015 22:05
Falcor with express featuring split route files and route access logging
// ...
// ... SNIP: You should include and wire up express as needed before this
// ...
// Falcor deps
var falcor = require('falcor');
var falcorExpress = require('falcor-express');
var bodyParser = require('body-parser');
// ROUTES
@jimthedev
jimthedev / LifecycleCallbackTracker.ts
Last active September 23, 2015 21:06
Lifecycle callback tracking / logging for Angular 2 (with console color by component)
/**
* Have your component extend this class temporarily when you
* need lifecycle callback tracking / debugging. See second
* file for how to use this class in your component.
*/
class LifecycleCallbackTracker {
staticCallCounts: Object = {};
textColor: string;
constructor(textColor?: string) {
@jimthedev
jimthedev / init-angular2-ts-jspm
Created July 7, 2015 15:17
Angular2, TypeScript, JSPM starter script
# DESCRIPTION
# Performs the commands needed to download and set up a new angular2 project using typescript and jspm
#
# Assumes you have these:
# - git
# - node / io.js
# - npm
# - npm install -g jspm@beta **NOTE**: you must have the beta release of jspm installed
#
# USAGE
@jimthedev
jimthedev / typescript.json
Created September 23, 2015 05:16
A few Visual Studio Code 0.8 Snippets for TypeScript and Angular 2
{
"New NG2 Component (Item)": {
"prefix": "ng2c",
"body": [
"import {Component, View, CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/angular2';",
"// import {ExampleListComponent} from '../example/example-list.component';",
"",
"@Component({",
" selector: '${1:dashed-name}',",
" properties: ['id']",
@jimthedev
jimthedev / ionic-toggle-platform-bookmarklet.js
Last active December 7, 2015 18:54
Ionic2 page reload bookmarklet to toggle between ionic platforms
javascript:void((function(){var loc = location.href; var base = loc.split('?')[0]; loc.indexOf("?") == -1 || loc.indexOf("?ionicplatform=ios") > -1 ? (location.href = base+"?ionicplatform=android") : (location.href = base+"?ionicplatform=ios");})());