This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var domify = require('domify'); | |
document.body.appendChild(domify('<p>2</p>')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var locationtApp = angular.module('locationApp', []); | |
locationtApp.controller('LocationListCtrl', ['$scope', function ($scope) { | |
var phones = [ | |
{ | |
'src': 'http://localhost/images/image1.jpg' | |
}, | |
{ | |
'src': 'http://localhost/images/image2.jpg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf ~/.npm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Instafeed = require('instafeed.js'), | |
domReady = require('domready'), | |
domify = require('domify'); | |
domReady(function () { | |
document.body.appendChild(domify('<div class="instafeed"></div>')); | |
var likes = false, | |
feed = new Instafeed({ | |
get: 'tagged', | |
tagName: 'proudtobeabulldog', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint node:true*/ | |
var domReady = require('domready'), | |
domify = require('domify'), | |
Instafeed = require('instafeed.js').Instafeed, | |
instafeedPlugin = function (opts) { | |
'use strict'; | |
var haveSome = false, | |
loading = opts.loading, | |
filter = (function (filter) { | |
if (typeof filter === 'function') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
platform: 'Android', | |
url: 'https://play.google.com/store/apps/details?id=de.schildbach.oeffi' | |
}, | |
{ | |
platform: 'iPhone', | |
url: 'https://itunes.apple.com/app/id378458261' | |
} | |
].forEach(function (o) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var domready = require('domready'), | |
React = require('react'), | |
Reflux = require('reflux'); | |
var button = Reflux.createActions(['toggle']); | |
var list = Reflux.createActions(['select']); | |
var storeButton = Reflux.createStore({ | |
listenables: list, | |
onSelect: function (color) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn a2s [a] | |
(reduce | |
(fn [s n] | |
(str s (str " " n))) | |
(str (first a)) | |
(rest a))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn doubleBooked [events] | |
(let [sortedEvents (sort-by :start events) | |
toAdd true | |
notToAdd false] | |
(loop [head (first sortedEvents) | |
isAdd notToAdd | |
events (rest sortedEvents) | |
intersect []] | |
(let [neck (first events) | |
tail (rest events)] |
OlderNewer