Skip to content

Instantly share code, notes, and snippets.

Michael Ebens mebens

Block or report user

Report or block mebens

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mebens
mebens / simple_ruby_server.rb
Created Jan 28, 2011
A very simple Ruby server setup.
View simple_ruby_server.rb
require 'gserver'
class MyServer < GServer
def initialize(port=12345, *args)
super(port, *args)
end
def serve(io)
io.puts("The time is currently #{Time.now}")
end
View gist:838371
This is gist.
There are none like it, but this one is somebody's.
It is Bob's life.
I must master eggs as I must master my spam.
Without Tom gist is useless.
Without gist, splatted, fried cheese with sweet chilli sauce is useless.
@mebens
mebens / color-output.rb
Created Apr 20, 2011
Simple module for colour output to the terminal.
View color-output.rb
module ColorOutput
RED = 31
GREEN = 32
YELLOW = 33
BLUE = 34
MAGENTA = 35
CYAN = 36
def self.wrap(s, start_code, end_code = nil)
end_code = start_code - (start_code % 10) + 9 if end_code.nil?
View oopsnik-syntax.lua
class('Foo', BaseClass, function(self) -- base class is optional
function instanceFunction(...)
-- ...
end
function self.classFunction(...)
-- ...
end
end)
@mebens
mebens / api.lua
Created Apr 26, 2011
API suggestions for kikito. api.lua is the usage. implementation.lua is a possible implementation.
View api.lua
tween.update(dt)
tween(t, goal, callback, easing)
View metatable-thing.lua
foo = { hello = 3, world = 4 }
bar = setmetatable({ exclamation = 5 }, { __index = foo })
x = table.attributes(bar) -- I have no idea what would be a fitting name for this function
-- x = { hello = 3, world = 4, exclamation = 5 }
@mebens
mebens / transition.scss
Created May 25, 2011
A transition Sass mixin
View transition.scss
@mixin transition($type, $time, $ease) {
-webkit-transition: $type $time $ease;
transition: $type $time $ease;
}
@mebens
mebens / big-buttom.scss
Created Jun 5, 2011
The CSS and Sass code for my blog on making a 3D CSS button.
View big-buttom.scss
// These are some nice reusable mixins I keep around
@mixin transition($type, $time, $ease) {
-webkit-transition: $type $time $ease;
transition: $type $time $ease;
}
@mixin border-radius($length) {
border-radius: $length;
-webkit-border-radius: $length;
View gist:1044222
Also installing dependencies: libsgml
==> Downloading http://www.hick.org/code/skape/libsgml/libsgml-1.1.4.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
@mebens
mebens / gist:3911360
Created Oct 18, 2012
Hz frequencies of the notes from eight octaves in a Lua table.
View gist:3911360
-- converted from http://www.seventhstring.com/resources/notefrequencies.html
notes = {
[0] = { ["c"] = 16.35, ["c#"] = 17.32, ["d"] = 18.35, ["d#"] = 19.45, ["e"] = 20.60, ["f"] = 21.83, ["f#"] = 23.12, ["g"] = 24.50, ["g#"] = 25.96, ["a"] = 27.50, ["a#"] = 29.14, ["b"] = 30.87, },
[1] = { ["c"] = 32.70, ["c#"] = 34.65, ["d"] = 36.71, ["d#"] = 38.89, ["e"] = 41.20, ["f"] = 43.65, ["f#"] = 46.25, ["g"] = 49.00, ["g#"] = 51.91, ["a"] = 55.00, ["a#"] = 58.27, ["b"] = 61.74, },
[2] = { ["c"] = 65.41, ["c#"] = 69.30, ["d"] = 73.42, ["d#"] = 77.78, ["e"] = 82.41, ["f"] = 87.31, ["f#"] = 92.50, ["g"] = 98.00, ["g#"] = 103.8, ["a"] = 110.0, ["a#"] = 116.5, ["b"] = 123.5, },
[3] = { ["c"] = 130.8, ["c#"] = 138.6, ["d"] = 146.8, ["d#"] = 155.6, ["e"] = 164.8, ["f"] = 174.6, ["f#"] = 185.0, ["g"] = 196.0, ["g#"] = 207.7, ["a"] = 220.0, ["a#"] = 233.1, ["b"] = 246.9, },
[4] = { ["c"] = 261.6, ["c#"] = 277.2, ["d"] = 293.7, ["d#"] = 311.1, ["e"] = 329.6, ["f"] = 349.2, ["f#"] = 370.0, ["g"] = 392.0, ["g#"] = 41
You can’t perform that action at this time.