Skip to content

Instantly share code, notes, and snippets.

@mikezter
mikezter / gist:1231954
Created September 21, 2011 12:53
Frozenrails Notes

Some Frozenrails Notes

Jeff Casimir(@j3): The Problem is your Ruby

  • do not improve Rails skills, instead:
    • OO
    • Ruby
    • Design
    • ...
@mikezter
mikezter / workers.rake
Created December 8, 2011 11:01 — forked from karmi/workers.rake
Rake taks to launch multiple Resque workers in development/production with simple management included
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.
@mikezter
mikezter / gitlog.sh
Created January 13, 2012 14:32
Extract a a git-log for each month
#/bin/bash
year=2011
function header {
begin='Tätigkeiten '
case $1 in
1) month='Januar ';;
2) month='Februar ';;
3) month='März ';;
@mikezter
mikezter / hide.js
Created September 18, 2012 16:09
hide specs in github changelog
$('div[data-path^="spec"]').parent('div').hide();
@mikezter
mikezter / copy.go
Created September 21, 2012 23:22 — forked from anonymous/copy.go
package main
import (
"fmt"
"io"
"io/ioutil"
"math"
"math/rand"
"os"
"strings"
@mikezter
mikezter / gist:3933032
Created October 22, 2012 18:03
I love how good specs read like an instruction manual!
mokbook:ethon mike$ rspec
Starting 1 test servers
Waiting for servers to start...
Servers are up!
Ethon::Easy::Form
.new
defines finalizer
assigns attribute to @params
#first
@mikezter
mikezter / fibu.lisp
Created January 27, 2013 01:12
Fizzbuzz Golf
(defun m (x i) (= 0 (mod x i)))
(defun fibu (x)
(cond
((m x 15) "FizzBuzz")
((m x 3) "Fizz")
((m x 5) "Buzz")))
(loop for i from 1 to 100 do
(princ (or (fibu i) i))
@mikezter
mikezter / devteam.sh
Created April 5, 2013 09:08
# This script will add a user "devteam" with password "devteam" and allow him to # view your screen.
#!/bin/bash
#
# This script will add a user "devteam" with password "devteam" and allow him to
# view your screen.
dscl . -delete /Users/devteam &> /dev/null
maxid=$(dscl . -list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1)
newid=$((maxid+1))
@mikezter
mikezter / bahama_mama.rb
Created April 16, 2013 16:15
Bahama Mama
class BahamaMama < RTanque::Bot::Brain
NAME = 'Bahama Mama'
include RTanque::Bot::BrainHelper
FULL_ANGLE = Math::PI * 2.0
HALF_ANGLE = Math::PI
EIGHTH_ANGLE = Math::PI / 4.0
QUARTER_ANGLE = Math::PI / 2.0
ONE_DEGREE = FULL_ANGLE / 360.0
FULL_RANGE = (0..FULL_ANGLE)
" markdown.vim
" Markdown preview using RDiscount ruby gem.
" Put this file into .vim/ftplugin
command! -nargs=0 MarkdownPreview call MarkdownRenderBufferToPreview()
noremap <buffer> <Leader>rp :MarkdownPreview<CR>
setlocal ignorecase
setlocal wrap