Skip to content

Instantly share code, notes, and snippets.

@cj
cj / index.html
Created July 14, 2011 12:36 — forked from jonalter/index.html
Titanium Desktop file upload example
<html>
<head></head>
<body style="background-color:#ffffff;margin:10px">
<script>
var uploadFile = function(){
var text = document.getElementById('txt');
var dir = Titanium.Filesystem.getResourcesDirectory();
sep = Titanium.Filesystem.getSeparator(),
// filename = 'test.txt',
@cj
cj / express_app.coffee
Created September 3, 2011 21:31 — forked from tanepiper/express_app.coffee
CoffeeScript version of the default expressjs application generated by express
# Module Dependencies
express = require 'express'
app = module.exports = express.createServer();
# Configuration
app.configure () ->
app.set 'views', "#{__dirname}/views"
app.set 'view engine', 'jade'
@cj
cj / gist:1234672
Created September 22, 2011 12:44
Node.js Campfire bot
// main app.js
var client = require('ranger').createClient('ROOM',
'SECRET');
var timestamp = require('./timestamp').timestamp;
var getWeatherWrapper = require('./weather').getWeatherWrapper;
var showMap = require('./map').showMap;
var getTweets = require('./tweets').getTweets;
client.room(ROOMID, function(room) {
@cj
cj / LICENSE.txt
Created February 15, 2012 15:54 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@cj
cj / gemspec-usage.md
Created March 3, 2012 03:56 — forked from holman/gemspec-usage.md
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'

@cj
cj / helpers.rb
Created March 8, 2012 21:05 — forked from ogredude/helpers.rb
module Helpers
def sign_in(user)
@user_session = UserSession.create user
end
def fill_in_autocomplete(selector, value)
page.execute_script %Q{$('#{selector}').val('#{value}').keydown()}
end
def choose_autocomplete(text)
@cj
cj / hack.sh
Created March 19, 2012 14:05 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cj
cj / hash.rb
Created March 4, 2014 05:06 — forked from rmw/hash.rb
class Hash
# options:
# :exclude => [keys] - keys need to be symbols
def to_ostruct_recursive(options = {})
convert_to_ostruct_recursive(self, options)
end
private
def convert_to_ostruct_recursive(obj, options)
result = obj
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@cj
cj / gitlab.sh
Created February 24, 2016 06:13 — forked from sanand0/gitlab.sh
Installing Gitlab
# Gitlab 5.1: https://github.com/gitlabhq/gitlabhq/blob/5-1-stable/doc/install/installation.md
# Set up an AWS EC2 Ubuntu 12.04 LTS Server.
# Use ap-southeast-1b: spot pricing is smoother
# Log in as ubuntu@
sudo apt-get -y update
sudo apt-get -y upgrade
# Install the required packages.