Skip to content

Instantly share code, notes, and snippets.

@ruzz311
ruzz311 / a2VHost install.sh
Created March 28, 2013 02:32
Some things I installed to get a nodejs app server running on a2Hosting's CloudVM (ubuntu)
sudo apt-get install git;
sudo apt-get install python g++ make;
sudo apt-get install python-software-properties;
sudo apt-get install g++ curl libssl-dev apache2-utils;
sudo apt-get update;
sudo add-apt-repository ppa:chris-lea/node.js;
sudo apt-get update;
sudo apt-get install nodejs;
// install the 'request' package first with 'npm install request'
var request = require('request');
// replace with your Keen IO project token
var projectToken = "501999234-FAKE-PROJECT-ID";
// create a sample JSON event for an event collection
var eventCollection = "meals";
var sampleEvent = {
username: "ralph",
@ruzz311
ruzz311 / twilio-express.js
Last active December 18, 2015 12:28
playing with twilio
/**
* Module dependencies.
*/
var express = require('express'),
http = require('http'),
path = require('path'),
twilio = require('twilio'),
radish = "\"In all my days as a turnip farmer, I have not yet experienced the love, of a white radish!\", thought the farmer as he sighed then walked up the dusty warn trail, towards the barn. How long had he been there? One hour? Two Hours? The sun was shining bright and warm against the old man's skin and that's when he drifted off to sleep.";
persona = {
@ruzz311
ruzz311 / Gruntfile.js
Created July 11, 2013 20:13 — forked from kristoferjoseph/Gruntfile.js
Helpful build config
/*global module:false, require:false*/
var path = require('path'),
lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var folderMount = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};
module.exports = function(grunt) {
/**
* iOS 6 style switch checkboxes
* by Lea Verou http://lea.verou.me
*/
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */
position: absolute;
opacity: 0;
}
@ruzz311
ruzz311 / fightcode.turretbot.js
Created August 22, 2013 15:01
fightcode.turretbot.js
/**
objectives = ['seek', 'attack', 'evade', 'shit']
**/
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.rotate = 180;
this.direction = 1;
@ruzz311
ruzz311 / simple-router.js
Last active December 22, 2015 16:09
my favorite router so far
define([
// Application.
'app',
'modules/section'
], function (app, Section) {
var Router = Backbone.Router.extend({
routes : {
'' : 'index',
'*route' : 'allRoutes'
@ruzz311
ruzz311 / challenge2.js
Created October 26, 2013 17:03
Challenge 2. You should generate users.json from http://www.json-generator.com/
// responds to /users (returns users)
// post to { me: 'name', oldest: oldestId } to /oldest (checks against the oldest)
var http = require('http'),
url = require('url'),
users = require('./users.json'),
options = { port: 8000 },
oldest = users[0];
for (var i in users) {
@ruzz311
ruzz311 / clickingbad.js
Last active December 26, 2015 20:39
wheres the fun in a game if you don't cheat?
// http://clickingbad.nullism.com/
var rwmT,
rwmCnt = 1,
rwmLoop = function () {
if (rwmCnt%3 === 0) {
gm.do_sell_click();
rwmCnt = 0;
console.log('selling')
} else {
@ruzz311
ruzz311 / testflightUploader.sh
Last active December 29, 2015 00:59
A simple bashscript to bulk upload testflight builds
#!/bin/bash
# TESTFLIGHT_UPTOKEN and TESTFLIGHT_TEAMTOEKN are environment variables
# you can replace them directly with your tokens, but a environment is cooler.
NOTES="you can have multi-line notes here
that will upload with all ipa files"
makeCall(){
curl http://testflightapp.com/api/builds.json \