Skip to content

Instantly share code, notes, and snippets.

View cgkio's full-sized avatar

Christian Kessler IV cgkio

View GitHub Profile
@cgkio
cgkio / angular-js-steroids-example-app.md
Created October 17, 2013 18:22
Generates an Angular.js resource that syncs data in an external CouchDB database with a local TouchDB database.
$ steroids generate ng-touchdb-resource AppName

Options:

  • resourceName: name of resource to create. Example: 'car' will result in the following files:

    app/controllers/car.js
    app/models/car.js
    app/views/car/index.html
    app/views/car/show.html
    app/views/layouts/car.html

@cgkio
cgkio / varnish.md
Created October 17, 2013 18:40
Why Nginx is the (non node.js) server of choice?

Sometimes the best things are the most humble and unassuming ones. Stacks like the Apache HTTP Server, Nginx, and Node.js may be powering more and more of the Web, but let's not overlook their invisible helpers. Varnish is an HTTP caching and acceleration proxy, designed to do one thing and do it well: make Web pages load faster. The creators boast speedups of anywhere from 300 to 1,000 times, "depending on your architecture." Varnish comes with its own configuration language to allow fine-tuning for your needs, add-on modules for dealing with everything from authentication to secure downloads, and extremely liberal licensing.

@cgkio
cgkio / steroids-angular-local.md
Created October 17, 2013 19:46
Generates an Angular.js resource with local data.
$ steroids create APP_NAME  

$ cd APP_NAME  

$ steroids generate ng-resource RESOURCE_NAME

RESOURCE_NAME of 'car' will result in the following files:

app/controllers/car.js

app/models/car.js

@cgkio
cgkio / steroids-generate.txt
Created October 17, 2013 20:18
shell output for $ steroids generate
example:
Usage: steroids generate example <exampleName>
Generates an example demonstrating a Steroids feature.
Options:
- exampleName: name of the example to generate.
Available Steroids examples:
@cgkio
cgkio / new_gist_file
Created October 28, 2013 17:45
Prettify JS + CSS + HTML
Cmd + Shift + H
@cgkio
cgkio / whichnode.sh
Created October 28, 2013 17:54
Get Node.js (current) source path
$ which node
@cgkio
cgkio / html5mobileboilerplate
Created October 28, 2013 18:16
Scaffolds out H5BP Mobile Boilerplate
install: $ npm install -g generator-mobile-boilerplate
run: $ yo mobile-boilerplate
http://html5boilerplate.com/mobile/
@cgkio
cgkio / yeoman_angularjs_workflow
Created October 28, 2013 18:20
Workflow for AngularJS Yeoman generator
npm install -g generator-angular $ install generator
yo angular $ scaffold out a AngularJS project
bower install angular-ui $ install a dependency for your project from Bower
grunt test $ test your app
grunt server $ preview your app
grunt $ build the application for deployment
@cgkio
cgkio / steroids_yeoman
Created October 28, 2013 18:38
Steroids.js Yeoman generator
Install the Steroids generator with:
$ npm install generator-steroids -g
# Create a new Steroids project with Steroids npm and go to the folder, then:
$ yo steroids:ng-resource
# .. and give your resource a name. The resource files will be created and Bower will install all required dependencies
@cgkio
cgkio / fastbutton.js
Created October 30, 2013 15:09 — forked from fwebdev/fastbutton.js
Remove 300ms jQuery Mobile click delay
//What is this all about: http://code.google.com/intl/de-DE/mobile/articles/fast_buttons.html
//This Version "forked" from: http://forum.jquery.com/topic/how-to-remove-the-300ms-delay-when-clicking-on-a-link-in-jquery-mobile
//======================================================== FASTCLICK
function FastButton(element, handler) {
this.element = element;
this.handler = handler;
element.addEventListener('touchstart', this, false);
};
FastButton.prototype.handleEvent = function(event) {