Skip to content

Instantly share code, notes, and snippets.

@chantastic
chantastic / directives.js
Created November 26, 2012 22:18 — forked from abourget/directives.js
Hammer.js integration with AngularJS
/**
* 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:
*
@chantastic
chantastic / SassMeister-input.scss
Created November 13, 2015 06:04
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
/* fighting bem */
/* a simple todo-list. B, E, no M */
.todo-item { color: #eee }
.todo-item__mark { content: '*' }
@chantastic
chantastic / SassMeister-input.scss
Last active November 13, 2015 06:04
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
/* fighting bem */
/* a simple todo-list. B, E, no M */
.todo-item { color: #eee }
.todo-item__mark { content: '*' }

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 August 1, 2013 15:51
Setting up ng-resouce in an angular app.
'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 December 20, 2015 12:39
Setting up ng-resouce in an angular app.
'use strict';
var stintApp = angular.module('stintApp', ['ngResource'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/projects', {
@chantastic
chantastic / JavaScript-fatigue-reply.markdown
Last active December 29, 2015 05:57
JavaScript Fatigue Reply
@chantastic
chantastic / SassMeister-input-HTML.haml
Created December 9, 2013 21:40
Generated by SassMeister.com.
/ 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 December 10, 2013 00:10
Generated by SassMeister.com.
%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 January 28, 2014 16:56
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
.has-tip,
[data-has-tip=true]
&.tip--top,
&[data-tip-options*=top],
&