Skip to content

Instantly share code, notes, and snippets.

rails new app_name -T


rvm --create --ruby-version use ruby-2.2.1@app_name

Gemfile

group :test do
wifi.setmode(wifi.STATION)
wifi.sta.config('YOUR_SSID','YOUR_SSID_PWD')
wifi.sta.connect()
tmr.alarm(1, 5000, 1, function()
if wifi.sta.getip()== nil then
print('IP unavaiable, waiting...')
else
tmr.stop(1)
print('IP is '..wifi.sta.getip())
@joelbyler
joelbyler / gdcr2014cle
Created November 13, 2014 15:33
Notes for GDCR 2014 Cleveland
Published slide deck
https://docs.google.com/presentation/d/12oIvAzltmQC2aDV39kn5DkaC3IxAiqbtbCTWfo40xso/pub?start=true&loop=true&delayms=3000
Conway's game of life
http://en.wikipedia.org/wiki/Conway's_Game_of_Life
4 rules of simple design
http://www.slideshare.net/stevenbeeckman/4-simple-rules-of-design
@joelbyler
joelbyler / gist:d0453ffefbd85b58ef9a
Created July 28, 2014 13:50
Simple html to pdf example using TuesPechkin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TuesPechkin;
namespace SimpleHtmlToPdfConsole
{
class Program
@joelbyler
joelbyler / gist:387dc4c95d562ee35d45
Created June 5, 2014 22:56
Bowling Kata starter from clerb
class BowlingCalc
attr_reader :score
def initialize
@score = 0
end
def roll(pins)
@score += pins
end
end

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@joelbyler
joelbyler / vim.md
Last active May 26, 2017 03:12
Vim cheat sheet

#Cursor movement

h - move left
j - move down
k - move up
l - move right
ctrl-b - page up
ctrl-f - page down
% - jump to matching brace

w - jump by start of words (punctuation considered words)

@joelbyler
joelbyler / gist:10219412
Created April 9, 2014 02:10
Angular.js + jQuery + Harvest/Chosen + Custom Directive
<script>
var app = angular.module('myApp', []);
var myController = app.controller('myController', ['$scope', function ($scope, $timeout) {}]);
myController.directive('chosen', function(){
var linker = function(scope, element, attrs, ngModel) {
var model = attrs['ngModel'];
scope.$watch(model, function () {
@joelbyler
joelbyler / gist:9554291
Created March 14, 2014 18:52
Pretty JSON Endpoint Tool
curl http://198.45.124.159/job/CSA_Report_Analytics_Tool/api/json | python -mjson.tool
@joelbyler
joelbyler / police_cruiser_lights
Created February 15, 2014 17:17
Police Cruiser Lights Sketch
// PIN 1 is light bar power
// PIN 2 is red light on light bar
// PIN 3 is white driver side light
// PIN 4 is white passenger side light
// PIN 5 is blue light on light bar
// PIN 6 is marker lights
int led1 = 8;
int led2 = 9;
int led3 = 10;
int led4 = 11;