Skip to content

Instantly share code, notes, and snippets.

View Dakuan's full-sized avatar
💭
😆

Dakuan

💭
😆
View GitHub Profile
@Dakuan
Dakuan / scraper.js
Created May 28, 2012 16:09
Scraper
// the scraper module
// you need to set it's gubbins with manipulate and get methods
var Scraper = function(){
// public
setGubbins = function(gubb){
gubbins = gubb;
},
@Dakuan
Dakuan / scrapey
Created July 6, 2012 10:35
stuff for josh
var dress = subPage.evaluate(function(){
//return a bullshit object
return {
id: '123'
};
// all the other stuff
});
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
#header { margin: 30px 0; }
#header .logo { float: left; width: 12.5%; margin: 0 10px; }
#header .logo img { max-width: 100%; }
#header .logo .seperator { display: none; position: absolute; width: 30px; top: 0; bottom: 0; left: -30px; background: transparent url('/assets/background/search-sep.png') repeat-y left top; }
#header .header_main { margin-left: 14.583333333333%; }
#header {
margin: 30px 0;
.logo {
float: left;
width: 12.5%;
margin: 0 10px;
img {
max-width: 100%;
}
.seperator {
@Dakuan
Dakuan / gist:5123777
Created March 9, 2013 10:32
fix bug on line 37
$shadow-color: #d7d8d8
#header {
.page_options{
.options:hover {
z-index: 2000;
border: 1px
solid #d5d5d5;
border-bottom: 1px solid #dcdcdc;
@include box-shadow(2px 2px 2px $shadow-color);
@Dakuan
Dakuan / gist:5349851
Created April 9, 2013 22:07
Coffeescript jasmine spec
describe "Tip Model", ->
it "should exist", ->
expect(Mychicken.Models.Tip).toBeDefined()
describe "Attributes", ->
it 'should have attributes', ->
tip = new Mychicken.Models.Tip()
expect(tip.attributes.content).toBeDefined()
expect(tip.attributes.html).toBeDefined()
@Dakuan
Dakuan / gist:5349866
Created April 9, 2013 22:09
Javascript jasmine spec
describe("Tip Model", function() {
it("should exist", function() {
return expect(Mychicken.Models.Tip).toBeDefined();
});
describe("Attributes", function() {
return it('should have attributes', function() {
var tip;
tip = new Mychicken.Models.Tip();
expect(tip.attributes.content).toBeDefined();
return expect(tip.attributes.html).toBeDefined();
@Dakuan
Dakuan / Simple Twitter Auth
Created July 1, 2013 11:01
Authenticate with the Twitter API using OAuth and Node.js
var OAuth2 = require('OAuth').OAuth2;
var https = require('https');
var oauth2 = new OAuth2(KEY, SECRET, 'https://api.twitter.com/', null, 'oauth2/token', null);
oauth2.getOAuthAccessToken('', {
'grant_type': 'client_credentials'
}, function (e, access_token) {
console.log(access_token); //string that we can use to authenticate request
var options = {
@Dakuan
Dakuan / parent
Last active December 26, 2015 03:09
Project.ParentModel = Backbone.Model.extend({
initialize: function(args){
// children is a collection
this.set('children', args.children);
this.listenTo(this.get('children'), 'add', this._onChildrenAdd);
},
_onChildrenAdd: function(child, collection){
this.set('total', collection.reduce(function(memo, ch){
return memo + ch.get('value');
}, 0))