Skip to content

Instantly share code, notes, and snippets.

VWAIT proc near
pusha
mov dx, 3DAh
v1:
in al, dx
and al, 008h
jnz v1
v2:
in al, dx
and al, 008h
@oem
oem / smallest viable ember.js app
Created January 9, 2013 12:35
minimalistic example for a new ember.js app in coffeescript
# Dependencies: jquery, handlebars.js, ember.js (1.0pre)
App = Em.Application.create()
App.ApplicationView = Em.View.extend
templateName: 'application'
App.ApplicationController = Em.Controller.extend
name: "oembot"
App.Router = Em.Router.extend
@oem
oem / gist:1303434
Created October 21, 2011 09:22
HTML5 desktop notifications - a simple example
(function ($) {
var notify, initialize, requestPermission;
notify = function () {
var notification;
if (window.webkitNotifications) {
if (window.webkitNotifications.checkPermission() > 0) {
window.webkitNotifications.requestPermission(this);
}
@oem
oem / gist:1290627
Created October 16, 2011 07:51
my notes to rachel davies' talk at magrails (very minimal)

The quest for agility

Rachel Davies

let's do the maximum agile rather than the minimum (pretending by having process-facades)

Agile != meeting hell

Agile is for developing software!

@oem
oem / gist:957699
Created May 5, 2011 19:18
small excercise to refresh some metaprogramming stuff
# just a small refresher on some meta stuff - haven't commited all of it to
# muscle memory yet
class NoteBook
attr_accessor :notes
class << self
attr_accessor :subclasses
end
File.open("file_with_utf-8_encoding.moo", "r:utf-8").read
@oem
oem / gist:834915
Created February 19, 2011 07:59
Use method_missing to dynamically create "faked" class methods
# method missing fun to fake class methods
class Foo
def tell(something)
puts something
puts yield
end
def self.method_missing(name, *args, &block)
@oem
oem / gist:834395
Created February 18, 2011 21:00
kestrels in rails
# in Combinatory Logic, a Kestrel is a function that returns a constant function
# An example would be to have a return value and injecting some side effects before returning the value
def first_user_notified
user = User.first
user.send_email("foo")
user
end
# => first user
@oem
oem / gist:758561
Created December 29, 2010 14:01
capybara date select step definition for cucumber
# capybara step definition for a quick and dirty date select
# For example:
# When I select "May 7, 2010" as the post "published_on" date
When /^I select "([^"]*)" as the (.+) "([^"]*)" date$/ do |date, model, selector|
date = Date.parse(date)
select(date.year.to_s, :from => "#{model}[#{selector}(1i)]")
select(date.strftime("%B"), :from => "#{model}[#{selector}(2i)]")
select(date.day.to_s, :from => "#{model}[#{selector}(3i)]")
end
@oem
oem / gist:746446
Created December 18, 2010 12:06
all my tools installed on this box?
#!/usr/bin/env ruby
# What's missing from my toolbox?
require "rubygems"
begin
require "term/ansicolor"
rescue LoadError
nil
end