Skip to content

Instantly share code, notes, and snippets.

View sjg's full-sized avatar

Steven Gray sjg

View GitHub Profile
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@sjg
sjg / twitterProxy.js
Last active December 18, 2015 19:19
A small twitter proxy server (written in node) for all the developers who want to keep their Twitter applications running and let node do the heavy OAuth lifting for you.
#!/usr/bin/env node
// Before running install
// -- npm install -g optimist oauth step colors express
var serverPort = 8008;
var argv = require('optimist')
.usage('Usage: --key=[consumer key] -secret=[consumer secret]')
.demand(['key', 'secret'])
@sjg
sjg / color-c
Created January 3, 2012 11:15
Color Lines in C
#include <stdio.h>
#define RESET 0
#define BRIGHT 1
#define DIM 2
#define UNDERLINE 3
#define BLINK 4
#define REVERSE 7
#define HIDDEN 8