Skip to content

Instantly share code, notes, and snippets.

View lancejpollard's full-sized avatar
🐢
Code

Lance Pollard lancejpollard

🐢
Code
View GitHub Profile
eric@edub:~/projects/projects/experiments  $ tower new myApp
path.existsSync is now called `fs.existsSync`.
   create : myApp/.gitignore
   create : myApp/.npmignore
   create : myApp/.slugignore
   create : myApp/Cakefile
   create : myApp/app/client/config/bootstrap.coffee
   create : myApp/app/client/stylesheets/application.styl
   create : myApp/app/client/controllers/applicationController.coffee
@lancejpollard
lancejpollard / dev_view.coffee
Created August 21, 2012 09:25 — forked from charlesjolley/dev_view.coffee
Adding event locks to Ember
# example view implements a simple dragging for mouse events.
Wall.DevView = Ember.View.extend
mouseDown: (ev) ->
ev.dispatcher.lock @, 'mouseMove', 'mouseUp'
@_mouseDown = @$().offset()
@_mouseDown.pageX = ev.pageX
@_mouseDown.pageY = ev.pageY
@_mouseDown.dispatcher = ev.dispatcher
console.log 'mouseDown'
@lancejpollard
lancejpollard / admin.html
Created August 21, 2012 23:47 — forked from kmiyashiro/admin.html
Mocha HTML spec
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../libs/mocha.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div id="mocha"></div>
<script src="../libs/mocha.js" type="text/javascript" charset="utf-8"></script>
@lancejpollard
lancejpollard / gist:3586229
Created September 1, 2012 20:26 — forked from edubkendo/gist:3585506
Sublime Text Plugins
Aug 30 11:02:59 <e_dub> luckysmack, what editor do you use?
Aug 30 11:03:31 <luckysmack> for basic stuff I use sublime text. but my main ide is idea.
Aug 30 11:03:47 <e_dub> https://github.com/wuub/SublimeREPL
Aug 30 11:03:55 <luckysmack> http://www.jetbrains.com/idea/http://www.jetbrains.com/idea/
Aug 30 11:04:15 <e_dub> coffeescript REPL with syntax highlighting and autocompletion , etc
Aug 30 11:04:25 <luckysmack> oh ive seen that before. but never really looked at it.
Aug 30 11:04:34 <luckysmack> nice
Aug 30 11:05:07 <e_dub> it works like a charm, of course I already use sublime's ability to run arbitrary code, build stuff, etc, but this is really sweet
@lancejpollard
lancejpollard / lyrics.rb
Created September 10, 2012 20:55 — forked from clarkware/lyrics.rb
Random Lyrics
#!/usr/bin/env ruby
# API Documentation at http://api.wikia.com/wiki/LyricWiki_API
require 'open-uri'
require 'json'
require 'tmpdir'
ARTIST = "Johnny Cash"
@lancejpollard
lancejpollard / preflightApi.js
Created September 20, 2012 17:14 — forked from j-mcnally/preflightApi.js
Express Middleware for CORS access.
module.exports = function preflightApi(){
return function preflightApi(req, res, next){
//this is where the magic happens
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, OPTIONS');
res.header('Access-Control-Allow-Headers', 'User-Agent, Accept-Language, Accept-Encoding, Accept-Charset, Connection, Content-Length, Origin, Pragma, Accept-Charset, Cache-Control, Accept, Content-Type, Sessionid');
res.header('Access-Control-Max-Age', '1000');
@lancejpollard
lancejpollard / lex.js
Created September 22, 2012 03:09 — forked from tj/lex.js
/**
* Scan the given `str` returning tokens.
*
* @param {String} str
* @return {Array}
* @api public
*/
module.exports = function(str) {
var indents = [0]
@lancejpollard
lancejpollard / OS Check
Created September 28, 2012 01:32 — forked from thehydroimpulse/OS Check
OS Check
ifneq (,$(findstring /cygdrive/,$(PATH)))
UNAME := Cygwin
else
ifneq (,$(findstring WINDOWS,$(PATH)))
UNAME := Windows
else
UNAME := $(shell uname -s)
endif
endif
@lancejpollard
lancejpollard / xlsxParser.js
Created September 30, 2012 21:38 — forked from trevordixon/xlsxParser.js
Parse an Excel xlsx file with javascript, jquery, and zip.js
/*
Relies on jQuery, underscore.js, Async.js (https://github.com/caolan/async), and zip.js (http://gildas-lormeau.github.com/zip.js).
Tested only in Chrome on OS X.
Call xlsxParser.parse(file) where file is an instance of File. For example (untested):
document.ondrop = function(e) {
var file = e.dataTransfer.files[0];
excelParser.parse(file).then(function(data) {
console.log(data);
@lancejpollard
lancejpollard / index.js
Created October 30, 2012 05:11 — forked from max-mapper/index.js
twitter bot for @sandyaid retweets
var crypto = require('crypto')
var request = require('request')
var url = require('url')
var irc = require('./IRC/lib/irc')
var ntwitter = require('ntwitter')
var twitter = require('twitter')
var qs = require('querystring')
// separate accounts to post and search because twitter was sending me 500s
// when I tried to use the same oauth creds for both twitter() and ntwitter()