Skip to content

Instantly share code, notes, and snippets.

View code-later's full-sized avatar

Dirk Breuer code-later

View GitHub Profile
@code-later
code-later / podcast.rb
Created October 19, 2013 15:09
Sample Guacamole Model
class Podcast
include Guacamole::Model
attribute :title, String
attribute :body, String
# Timestamp attributes are automatically added (created_at, updated_at)
end
@code-later
code-later / pinkiepie.yml
Created October 9, 2013 14:06
Pinkie Pie color schema to be used with base16 builder (https://github.com/chriskempson/base16-builder)
scheme: "PinkiePie"
author: "Dirk Breuer (http://tfcl.de)"
base00: "151515"
base01: "202020"
base02: "303030"
base03: "505050"
base04: "b0b0b0"
base05: "d0d0d0"
base06: "e0e0e0"
base07: "f5f5f5"
@code-later
code-later / pony.rb
Created July 2, 2013 18:43
Shoes Pony Example for SIGINT
Shoes.app width: 600, height: 600 do
@knopf = button("Start", left: 300, top: 300) do
@pinky = image "/Users/dbreuer/Desktop/pinkie.png", width: 120, left: 0
@dash = image "/Users/dbreuer/Desktop/dash.png", width: 120, left: 400
@knopf.hide
end
#@mein_kreis = oval(0, 100, 25, fill: red, stroke: pink)
#animate 60 do
@code-later
code-later / README.markdown
Created June 10, 2013 09:28
base16 color scheme

This is my color scheme definition to be used with @chriskempson base16 builder. It is based on the original base16 color set with some pink modifications. I use the resulting 256 colors variant.

class Gateway
attr_reader :connection
def initialize(connection = Application.config.default_connection)
@connection = connection
end
def get(params)
request(:get, params)
end
# Verdienstziele und weitere Parameter
# ===============================================================================================
Jahr=2012
# Gewerbesteuer berücksichtigen, "ja" oder "nein"?
GewerbesteuerEinrechnen = "nein"
# Jeweilige Jahresziele sollten in 10 Monaten erreicht werden
# ...wegen Weiterbildungen, Urlaub, Krankheit, Open Source Contribution
# MaxStd entspricht dabei dann 100% Auslastung
@code-later
code-later / multiple_ssh_tunnels.rb
Created January 9, 2013 08:58
Open multiple SSH tunnels to forward resque-web instances via Capistrano.
Capistrano::Configuration.instance(:must_exist).load do
set :resque_local_start_port, 7070
set :resque_remote_port, 8282
def resque_local_ports
@resque_local_ports ||= Enumerator.new do |yielder|
current_port = fetch(:resque_local_start_port)
loop do
yielder.yield current_port
current_port += 1
@code-later
code-later / gist:3137064
Created July 18, 2012 15:49
Run Ruby from a Vim buffer
autocmd FileType ruby compiler ruby
function Run()
let executable=b:current_compiler
if !getbufvar("%", "&saved")
let tmpfile = tempname()
silent! exe "write " . tmpfile . ".rb"
endif
@code-later
code-later / a.md
Created June 29, 2012 08:57 — forked from tisba/a.md

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Netflix
  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
@code-later
code-later / class.c
Created June 21, 2012 06:43
Is Ruby's put implemented with method_missing?
// The 'rb_define_global_function' can be found in class.c
/*!
* Defines a global function
* \param name name of the function
* \param func the method body
* \param argc the number of parameters, or -1 or -2. see \ref defmethod.
*/
void
rb_define_global_function(const char *name, VALUE (*func)(ANYARGS), int argc)