Skip to content

Instantly share code, notes, and snippets.

View reubano's full-sized avatar

Reuben Cummings reubano

View GitHub Profile
@mariocesar
mariocesar / README.md
Last active August 29, 2015 14:04
Ubuntu Server + Nginx + Dropbox + uwsgi Apps

Install

Create a websites user.

sudo adduser --disabled-password --home /src/websites websites

Login and install dropbox.

sudo -s su - websites

@dsibilly
dsibilly / related_models.py
Created May 11, 2011 20:31
SQLAlchemy related models demo
@acdha
acdha / postmkvirtualenv
Created September 2, 2011 13:07
My virtualenvwrapper postmkvirtualenv hook
#!/bin/bash
# This hook is run after a new virtualenv is activated.
set -e
(cat <<'PYDOC'
#!/usr/bin/env python
import pydoc
if __name__ == '__main__':
pydoc.cli()
@reubano
reubano / formatstrings.R
Created October 12, 2011 11:48
Choropleths in R
#load data
stateAbbr rownames(stateAbbr)unemp_data
#get county names in correct format
countyNames counties statesstates
#concatenate states and counties
unemp_data$counties
#parse out county titles & specifics
@milosdakic
milosdakic / stream.js
Created August 13, 2012 03:27
Backbone.js Collection/Model Stream mixin
/**
* Stream collection/model data.
* @exports mixins/Stream
* @module Stream
*/
var Stream = {
/**
* Is the collection steaming?
*
* @property streaming
@nickpoorman
nickpoorman / app.coffee
Created August 20, 2012 10:33
Express.js Backbone.js pushState router
# if the resource is not found then forward to backbone's router
app.use (req, res) ->
newUrl = req.protocol + '://' + req.get('Host') + '/#' + req.url
res.redirect newUrl
@ggaughan
ggaughan / pipeloadYQL.py
Created June 2, 2012 12:54
Initial YQL pipe loader mechanism
"""Pipe finders and loaders
Use these to import Yahoo! pipes as Python modules with support for nested imports
(C) Greg Gaughan, 2012
"""
"""Example usage (see __main__ below for a dynamic version):
import sys

Disclaimer: This post is Meteor & Backbone beef. Both Meteor and Backbone are absolute genius, and far beyond anything I could dream to create. But IMO there are better tools. Prepare yourselves *gulp*, I need to get this off my chest.

First, Backbone. Why people? It revolutionized JavaScript, did wonderful things for the world, and served its purpose well. But now we have better tools, so let’s move on. It’s like Gentoo users proselytizing Gentoo to the masses, perpetuating it as most common Distro; where all this time, Ubuntu would have saved everyone countless hours. Not

@avivkiss
avivkiss / Instructions.md
Last active December 14, 2015 11:09 — forked from danielres/README.markdown
Instructions for using Font Awesome with Octopress.

Edit: Apparently the sass file was removed from the latest versions of Font-Awesome... You can still download the sass file from GitHub here

  1. Download Font Awesome source
  2. Take the file sass/font-awesome.sass and put it in your octopress sass folder
  3. Rename it to _font-awesome.sass
  4. Create a directory 'octopress/source/font' and put the 4 font files there (ttf, svg, eot and woff).
  5. In your stylesheet (sass/screen.scss):
  • @import font-awesome
@harobed
harobed / gist:5845674
Created June 23, 2013 16:50
python assert equal with ellipsis
import unittest
import re
class BaseTest(unittest.TestCase):
def assertEqualEllipsis(self, first, second, ellipsis_marker='...', msg=None):
"""
Example :
>>> self.assertEqualEllipsis('foo123bar', 'foo...bar')