Skip to content

Instantly share code, notes, and snippets.

def method_name
"hello"
end
@bdtomlin
bdtomlin / gist:813e779c647978fc27e3
Created August 27, 2014 14:32
Vimux and Turbux
" for vim to interact with tmux
Bundle 'benmills/vimux'
" for awesome ruby testing
Bundle 'jgdavey/vim-turbux'
" My settings
"use closest pane already open (don't create split if there already is one)
let VimuxUseNearestPane = 1
" Create vertical split, no naturally use "h" for vertical :)
@bdtomlin
bdtomlin / designer.html
Created August 13, 2014 01:12
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
.mad-libs-content {
position: relative;
}
.animate-questions, .animate-results {
position: absolute;
top: 0;
left: 0;
right: 0;
}
@bdtomlin
bdtomlin / nginx
Created July 3, 2012 15:34
Nginx init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
// 1. Write a class to support the following code:
var Person = function(name){
this.name = name;
};
Person.prototype.getName = function(){
return this.name;
};
var thomas = new Person('Thomas');
@bdtomlin
bdtomlin / gist:3018831
Created June 29, 2012 16:04
HomeWork 2
Function.prototype.cached = function(){
var that = this;
var cache = {};
return function(arg){
if(arg in cache){
return cache[arg];
}else{
cache[arg] = that(arg);
return cache[arg];
}
@bdtomlin
bdtomlin / gist:3018817
Created June 29, 2012 16:02
HomeWork 1
var CARS = [
{ color: 'blue', make: 'BMW' },
{ color: 'red', make: 'Ferrari' }
];
var logCar = function(car){
console.log("I'm a " + car['color'] + ' ' + car['make'])
}
function Car(make, color){
var countdown = (function(){
var index;
function log(){
console.log(index);
}
function iterate(){
log();
@bdtomlin
bdtomlin / mongod ruby script
Created July 5, 2010 20:57
mongod ruby script
#!/usr/bin/env ruby
USAGE = %{
Usage:
Put this script somewhere in your path, I use ~/bin
chmod +x to make it executable
mongod start (starts mongod)
mongod stop (stops mongod)
mongod stat (calls ps aux|grep ... to see if mongod is running)