Skip to content

Instantly share code, notes, and snippets.

View gasp's full-sized avatar
🔧
hacking stuff

Gaspard Beernaert gasp

🔧
hacking stuff
View GitHub Profile
@mgng
mgng / instagrss_sample.php
Created April 10, 2014 00:25
instagrss_sample.php
<?php
$user_id = "parishilton";
$json = json_decode( file_get_contents( "http://instagram.com/{$user_id}/media" ) );
$results = array();
foreach( $json->items as $item ) {
$results[] = array(
"link" => $item->link,
"created_time" => $item->created_time,
"thumbnail_url" => $item->images->thumbnail->url,
@jeffcogswell
jeffcogswell / q_example.js
Last active August 12, 2022 01:22
Here's another chaining example on using q.js. This doesn't have any error handling, as I just want to demonstrate the chaining concept. Please read the comments carefully, as I start out with a non-q example, to show the order of flow. Please post comments if there's anything that isn't clear and I'll try to revise it as needed.
// Q sample by Jeff Cogswell
/*===========
We want to call these three functions in sequence, one after the other:
First we want to call one, which initiates an ajax call. Once that
ajax call is complete, we want to call two. Once two's ajax call is
complete, we want to call three.
BUT, we don't want to just call our three functions in sequence, as this quick
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 5, 2024 13:30
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@stoolrossa
stoolrossa / loadcouchdata.js
Created October 25, 2011 15:29
Loading data from PostGIS into CouchDB
var pg = require('pg'),
cradle = require('cradle');
var pgConnString = 'tcp://spatial:spatial@localhost/spatial';
var couchServer = 'localhost';
var couchPort = 5984;
var couchDatabase = 'spatial';
var couchConn = new cradle.Connection(couchServer, couchPort);
var couchDb = couchConn.database(couchDatabase);