Skip to content

Instantly share code, notes, and snippets.

View quartzmo's full-sized avatar

Chris Smith quartzmo

  • Google
  • Salt Lake City, Utah, USA
  • 09:42 (UTC -06:00)
View GitHub Profile
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
dc.ui.AnnotationEditor = Backbone.View.extend({
id : 'annotation_editor',
events : {
'click .close': 'close'
},
constructor : function(options) {
Backbone.View.call(this, options);
@mattsgarrison
mattsgarrison / bootstrap-paged-navar.js
Created January 12, 2012 14:46
CoffeeScript and JavaScript results to enhance Twitter Bootstrap navbar's "active" tab for multiple pages (essentially supplanting scrollspy).
// Generated Output from CoffeeScript
jQuery(function() {
var a, b, c, d, e;
d = $(".topbar .nav a"), e = [];
for (b = 0, c = d.length; b < c; b++)
a = d[b], e.push(function(a) {
if (window.location.pathname === a.pathname)
return $(a).parent().toggleClass("active")
}(a));
return e
@boucher
boucher / StripeTutorialPage.html
Created February 6, 2012 07:05
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
@juliocesar
juliocesar / awesome_router.coffee
Created May 21, 2012 17:00
AwesomeRouter: a cool Backbone.js router class
# AwesomeRouter: A class that I've been using throughout a few Backbone.js apps I've built.
#
# It adds 2 features: an event that gets fired when one calls `navigate` (aptly named
# "navigate"), so you can bind things to when a URL gets triggered. And a "before filter"
# method `before`, which you can use to run things before every a route gets triggered.
#
# This could easily be extended to have after filters too, or to only trigger a route
# upon @before returning something that's not false.
class AwesomeRouter extends Backbone.Router
@wrburgess
wrburgess / gist:3778949
Created September 24, 2012 22:54
Setup wicked_pdf and wkhtmltopdf with Rails 3 and Heroku
@paul-english
paul-english / Gruntfile.js
Created July 1, 2013 17:11
Gruntfile that makes use of assemble
// Generated on 2013-04-18 using generator-webapp 0.1.7
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
@erikflowers
erikflowers / Bootstrap-3-Smallest-Column-Mixin
Last active December 21, 2015 06:19
If you are building your Bootstrap 3 grid entirely using mixins, you need to declare a base column mixin for proper, full width columns at the smallest level. Otherwise, they lack the proper padding, min-height, and position as the same HTML markup column would have by default. This is used by adding .make-column(); at the base level before you …
// Generate a mixin for mobile full width columns, to maintain the same attributes
.make-column(@gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
}
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>