Skip to content

Instantly share code, notes, and snippets.

View joemccann's full-sized avatar
💭
Thinking

Joe McCann joemccann

💭
Thinking
View GitHub Profile
const tiny = require('tiny-json-http')
const schedule = require('node-schedule')
const {
error,
log
} = console
function main() {
@joemccann
joemccann / base64img.js
Created November 23, 2010 05:14
How?
var fs = require('fs'),
sys = require('sys'),
base64 = require('base64'); // this module is installed.
var foo = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAKIAeYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+kxbCMxpmNRGIwRyf9o5OCxyRtzuBfDE5Jzm/b6dA5JVFVwxJKkgEMzsApAUlgOPmBCgqx
@joemccann
joemccann / redis.conf
Created December 6, 2011 21:51
Standard Redis Conf with Authentication
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@joemccann
joemccann / jct-at-mother.md
Created December 17, 2013 15:33
Junior Creative Technologist Job At Mother New York

Job Opportunity at Mother NY

##Junior Creative Technologist

Mother New York is a creatively-driven agency in New York City. We exist to attract the most creative minds in the world, including our clients. Our client list includes Burger King, Tanqueray, Stella Artois, Virgin Mobile, Sour Patch Kids, Target, Microsoft and other world-class brands.

We are looking for an individual that can help us ….

Position: Permanent

#!/bin/bash
# Set variables
# -----------------------------------
GUNBOT_GITHUB_FOLDER_NAME="Gunbot6.0.2"
GUNBOT_GITHUB_FILE_NAME="GUNBOT_v6.0.2_Poloniex_Bittrex_Patch"
# Set functions
# -----------------------------------
upstream lb-subprint {
ip_hash;
server 192.241.180.249:3222 weight=10 max_fails=3 fail_timeout=30s; # Reverse proxy to machine-1
server 192.241.241.152:3222 weight=10 max_fails=3 fail_timeout=30s; # Reverse proxy to machine-2
}
server {
listen 80;
server_name www.subprint.com subprint.com;
@joemccann
joemccann / phonegap_sencha_tutorial.md
Created January 31, 2011 20:19
Quick setup of Phonegap and Sencha tutorial.

Note: You need to be on a Mac.

Note: This is purposely verbose. Yes, I know a lot of this can be simplified. Fork it and show me.

  1. Install git
  2. Open your terminal.
  3. mkdir ~/Documents/phonegap_sencha
  4. cd ~/Documents/phonegap_sencha
  5. git clone https://github.com/phonegap/phonegap-iphone.git && cd phonegap-iphone
  6. git reset --hard HEAD
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path('$'))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
@joemccann
joemccann / up.js
Created November 18, 2011 16:02
upload express example
app.post('/upload/photo', function(req, res, next){
var json_response = {}
req.form.complete(function (err, fields, files){
if (err){
next(err)
}
else{
// temporary filename
@joemccann
joemccann / offline-static.md
Created January 24, 2014 16:02
Mother Ski Trip Offline Site

Every year at Mother we have an all-agency ski trip.

This year, we want a responsive site that will work on phones while people are on the slopes. The cell phone coverage there is shit so offline is necessary.

We basically need a schedule of events, phone numbers, etc. Nothing serious and nothing super interactive.

However, we are considering a leaderboard of sorts for some activities, but not a dealbreaker if data is eventually consistent.

Nonetheless, background syncing of sorts and adding to home page is a requirement.