Skip to content

Instantly share code, notes, and snippets.

@chantastic
chantastic / directives.js
Created Nov 26, 2012 — forked from abourget/directives.js
Hammer.js integration with AngularJS
View directives.js
/**
* Inspired by AngularJS' implementation of "click dblclick mousedown..."
*
* This ties in the Hammer events to attributes like:
*
* hm-tap="add_something()"
* hm-swipe="remove_something()"
*
* and also has support for Hammer options with:
*
View ajax_boilerplate.js
var fetchingResource = null;
function AJAXBoilerplate () {
if(fetchingResource) {
fetchingResource.abort();
}
fetchingResource = $.ajax({
url: '/resource',
data: {},
cache: false,
View 0-Instructions.md

Testing OAuth Apis in rails 3.x apps

  1. Install phantomjs
  2. Add rspec, poltergeist, capybara, vcr to Gemfile
  3. bundle install
  4. Create spec/acceptance folder
  5. Create spec/acceptance/acceptance_helper.rb (see below)
  6. Create spec for oauth flow (see below) read the comments carefully

NB: My signup flow is something like:

@chantastic
chantastic / app.js
Created Aug 1, 2013
Setting up ng-resouce in an angular app.
View app.js
'use strict';
var stintApp = angular.module('stintApp', ['ui', 'ngResource'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/projects', {
@chantastic
chantastic / app.js
Last active Dec 20, 2015
Setting up ng-resouce in an angular app.
View app.js
'use strict';
var stintApp = angular.module('stintApp', ['ngResource'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/projects', {
@chantastic
chantastic / SassMeister-input-HTML.haml
Created Dec 9, 2013
Generated by SassMeister.com.
View SassMeister-input-HTML.haml
/ person listing page
%div#person-list
%div.person
default
%div.person.person--active
active
%div.person.person--pending
pending
@chantastic
chantastic / SassMeister-input-HTML.haml
Created Dec 10, 2013
Generated by SassMeister.com.
View SassMeister-input-HTML.haml
%button.btn .btn
%button.btn.btn--primary btn.btn--secondary
%button.btn.btn--warning btn.btn--warning
%button.btn.btn--danger btn.btn--danger
%button.btn.btn--link btn.btn--link
@chantastic
chantastic / SassMeister-input.sass
Created Jan 28, 2014
Generated by SassMeister.com.
View SassMeister-input.sass
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
.has-tip,
[data-has-tip=true]
&.tip--top,
&[data-tip-options*=top],
&
@chantastic
chantastic / gulpfile.js
Last active Nov 3, 2019
This a script for a Full Stack Talk, given 3/13/14. Feel free to follow along at your own pace.
View gulpfile.js
var gulp = require('gulp');
var coffee = require('gulp-coffee');
gulp.task('scripts', function () {
gulp.src('src/*.coffee')
.pipe(coffee())
.pipe(gulp.dest('./'));
});
gulp.task('watch', function () {
View gist:9916266
### Keybase proof
I hereby claim:
* I am chantastic on github.
* I am chantastic (https://keybase.io/chantastic) on keybase.
* I have a public key whose fingerprint is CCE2 FB27 EEB8 5D76 612F 5D4B 30F5 5B5D C3E0 34DE
To claim this, I am signing this object: