An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
require 'rubygems' | |
require 'hornetseye_ffmpeg' | |
require 'hornetseye_xorg' | |
require 'hornetseye_alsa' | |
include Hornetseye | |
input = AVInput.new 'sintel.mp4' | |
alsa = AlsaOutput.new 'default:0', input.sample_rate, input.channels | |
audio_frame = input.read_audio | |
X11Display.show 600, :output => XVideoOutput do |display| | |
img = input.read |
framework 'Cocoa' | |
framework 'QuartzCore' | |
class NSColor | |
def toCGColor | |
colorRGB = self.colorUsingColorSpaceName NSCalibratedRGBColorSpace | |
components = Array.new(4){Pointer.new(:double)} | |
colorRGB.getRed components[0], green:components[1], blue:components[2], alpha:components[3] |
require 'open-uri' | |
require 'nokogiri' | |
require 'parslet' | |
require 'csv' | |
# -------------------------------------------------- | |
# Auxiliary code | |
class String |
framework "WebKit" | |
class Widget | |
class RPC | |
class << self | |
public :include | |
end | |
def initialize(widget) | |
@widget = widget |
# General Apache options | |
AddHandler fcgid-script .fcgi | |
AddHandler cgi-script .cgi | |
#Options +FollowSymLinks +ExecCGI | |
# If you don't want Rails to look in certain directories, | |
# use the following rewrite rules so that Apache won't rewrite certain requests | |
# | |
# Example: | |
# RewriteCond %{REQUEST_URI} ^/notrails.* |
# Adapted from a script by Evan Phoenix | |
require 'benchmark' | |
GC::Profiler.enable | |
class Simple | |
attr_accessor :next | |
end | |
top = Simple.new |
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
puts DATA.read | |
labelnum = 0 | |
labelstack = [] | |
ARGF.each_char do |c| | |
puts " # #{c}" | |
case c | |
when '>' | |
puts ' addl $4, %eax' | |
when '<' |
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |