Skip to content

Instantly share code, notes, and snippets.

View captainill's full-sized avatar

Jonathan Thomas captainill

View GitHub Profile
define(function () {
'use strict';
var _ = require('underscore');
var ValidationMixin = {
getInitialState: function () {
return {
errors: []
@lawitschka
lawitschka / about.html.erb
Created September 23, 2013 07:47
Rendering sections of ERb templates in Markdown with Rails
<%= markdown do %>
# About
a paragraph....
* one
* two
<% end %>
@matthaliski
matthaliski / gist:4253339
Last active July 11, 2016 19:35
How to Post to a Google Spreadsheet

How to Post to a Google Spreadsheet

Part 1 - Setting up the Google Document

  • Go to Google Docs and create your spreadsheet
  • Give column names and make note of them as they become the names of your input fields
  • Give the spreadsheet the tab name of "DATA"
  • Click Tools > Script Editor
  • Choose 'Spreadsheet' under 'Create Script for'
@0xjjpa
0xjjpa / chrome.md
Created December 9, 2012 04:37
Understanding Google Chrome Extensions

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
@dustinsmith1024
dustinsmith1024 / heroku_commands.txt
Created February 17, 2012 01:19
Heroku Setups Custom Domains
Links:
http://devcenter.heroku.com/articles/custom-domains
http://joshkim.org/2010/03/15/custom-domain-names-on-heroku-via-namecheap/
Run the heroku commands to add custom domains
$ heroku addons:add custom_domains:basic
Adding custom_domains to myapp...done.
$ heroku domains:add www.example.com
@elranu
elranu / app.js
Created November 24, 2011 15:29
Socket.IO RedisStore and Rooms
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require('socket.io/node_modules/redis'),
io = require('socket.io').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});
@gnarf
gnarf / jQuery.ajaxQueue.min.js
Created June 21, 2011 23:52
jQuery.ajaxQueue - A queue for ajax requests
/*
* jQuery.ajaxQueue - A queue for ajax requests
*
* (c) 2011 Corey Frang
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
*/
(function(a){var b=a({});a.ajaxQueue=function(c){function g(b){d=a.ajax(c).done(e.resolve).fail(e.reject).then(b,b)}var d,e=a.Deferred(),f=e.promise();b.queue(g),f.abort=function(h){if(d)return d.abort(h);var i=b.queue(),j=a.inArray(g,i);j>-1&&i.splice(j,1),e.rejectWith(c.context||c,[f,h,""]);return f};return f}})(jQuery)
@rwaldron
rwaldron / dogfood-init.html
Last active September 25, 2015 09:17
Dogfood Pattern
<!doctype html>
<html>
<head>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="dogfood-init.js"></script>
</head>
<ul id="ui-menu-stuff">
</ul>
@rjrodger
rjrodger / streambuffer.js
Created March 28, 2011 11:16
A utility object that caches inbound HTTP data, allow you to attach your event handlers after you make other asynchronous requests.
function StreamBuffer(req) {
var self = this
var buffer = []
var ended = false
var ondata = null
var onend = null
self.ondata = function(f) {
for(var i = 0; i < buffer.length; i++ ) {