Skip to content

Instantly share code, notes, and snippets.

View aaronrussell's full-sized avatar

Aaron Russell aaronrussell

View GitHub Profile
@aaronrussell
aaronrussell / compile.rb
Created October 28, 2015 15:37 — forked from havenwood/compile.rb
Little script using mruby to compile to self-executable
#!/usr/bin/env ruby
class Compiler
def initialize
@mruby_dir = '/Users/shannonskipper/.rubies/mruby'
sanity_check_argv
@file = ARGV.first.sub /.rb$/, ''
end
def run
require "rubygems"
require "base64"
require "haml"
require "chunky_png"
module Sass::Script::Functions
def rgbapng(color)
chunky_color = ChunkyPNG::Color.rgba(color.red, color.green, color.blue, (color.alpha * 100 * 2.55).round)
image = ChunkyPNG::Image.new(1,1, chunky_color)