Skip to content

Instantly share code, notes, and snippets.

@ryanmcgrath
ryanmcgrath / twitter_streaming.js
Created February 18, 2011 08:02
Access the Twitter Streaming API with ease (Node.js).
var util = require('util'),
http = require('http'),
events = require('events');
var Twitter = function(opts) {
this.username = opts.username;
this.password = opts.password;
this.track = opts.track;
this.data = '';
};
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 5, 2024 06:45
A badass list of frontend development resources I collected over time.
@thedillonb
thedillonb / frontendDevlopmentBookmarks.md
Created July 3, 2013 04:52 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@brookr
brookr / postgresql upgrade.md
Last active December 19, 2015 10:09
Upgrading Postgresql from 9.2 to 9.3.1

Make a temporary home for the new database

mkdir -p /usr/local/var/postgres9.3

Tell postgres to set up the new database

initdb /usr/local/var/postgres9.3 -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'

Migrate the data

pg_upgrade -d /usr/local/var/postgres9.2/ -D /usr/local/var/postgres9.3/ -b /usr/local/Cellar/postgresql/9.2.1/bin/ -B /usr/local/Cellar/postgresql/9.3.1/bin/ -v

Make the new db the canonical db

@azylstra
azylstra / apod.py
Last active September 15, 2018 23:46
A simple python3 script to automatically download the latest Astronomy Picture of the Day (APOD) as an image and set it as the desktop background for all spaces in OS X. Because OS X is a bit unfriendly in how it lets you change the background, python launches an applescript that steps through each space individually. Note that this assumes you …
#!/usr/bin/env python3
# Download the daily APOD picture and set it as the system wallpaper on OS X
# @author Alex Zylstra
# @date 2013/10/05
__author__ = 'Alex Zylstra'
__date__ = '2013-10-05'
import urllib.request
import os
@jctoledo
jctoledo / instances.tab
Last active December 19, 2015 10:09
Sample instances.tab file used by https://github.com/micheldumontier/php-lib/blob/master/apps/manager.php This is a tab delimited file where its columns are: isql port, http port and desired instance name
#this is a comment
#isql-port http-port name
12001 12002 myFirstEndpoint
12003 12004 mySecondEndpoint
@lucastelnovo
lucastelnovo / Prototipo.groovy
Last active December 19, 2015 10:09
Implementación de la clase 'Prototipo' for dummies. Hecha con 'withParams'. Very verbose. Full comments.
class Prototipo {
static init() {
Object.metaClass {
prototype = null
// La inicializo en null porque cuando redefino el constructor, ahi le digo que será un mapa.
dynamicProperties = null
@jpgreenwald
jpgreenwald / persistence.xml
Created July 6, 2013 00:39
Java EE persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="db" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/DbPool</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit>
</persistence>