Mikhail Vaysman Vaysman

View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

View gist:9053305
1 2 3 4 5
# You will need the pygments and xclip packages
# This example highlights some Bash source code
# '-O noclasses=true' tells pygments to embed colors inline in the source
# the '-t text/html' option tells xclip what "target" to specify for the selection
pygmentize -l java -f html -O noclasses=true,encoding=utf-8 Main.java | pbcopy
View 123.tape
1 2 3 4 5 6 7 8 9
write 1
dump
right
write 2
dump
left
left
write 3
dump
View Gemfile
1 2 3 4
source :rubygems
 
gem 'sinatra'
gem 'sinatra-contrib'
View 0-readme.md

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

View s.rb
1 2 3 4 5
class S; def initialize *w; @s=w; end; def method_missing *w;@s<<w;self;end;def
to_ary;[@s.map{ |e| e=~/[\,\.\:\-\(\)\/\'\"]/?[e]:[" ",e] }.join.strip];end;end
def Object.const_missing(c);S.new c;end; ###### https://gist.github.com/2354740
 
puts This.is.a.sentence.represented.by.a.Ruby.expression(",").try.it.out! #####
View gist:1834468
1 2 3 4 5 6 7 8 9 10
class BlahBlah < ActiveRecord::Migration
def up
puts "Records: #{TestResult.count}\n"
Feature.destroy_all
TestResult.all.each do |e|
begin
e.update_attribute(:generated, nil)
rescue ActiveRecord::RecordInvalid => er
puts "###\nId: #{er.record.id}\n###\nErrors:\n\t#{er.record.errors.full_messages.join("\n")}\n"
end
View gist:1826863
1 2 3 4 5 6 7 8 9 10
def self.get_features(doc)
(doc / '//test-suite[@type="TestFixture"]').map do |e|
{
'name' => (e['description'] || e['name']).strip,
'scenarios_attributes' => get_scenarios(e),
'scenarios_attributes'.map do |scenario|
if (scenario.next['level'] == nil)
scenario.next['level'] = scenario['level']
scenario.next['runner'] = scenario['runner']
scenario
View README.md

First install the required gems:

gem install octokit awesomeprint rainbow

Then run it to extract all of your open GitHub issues into files (with comments).

ruby my-gh-issues.rb
View metakoans.rb
1 2 3 4 5 6 7 8 9 10
#
# metakoans.rb is an arduous set of exercises designed to stretch
# meta-programming muscle. the focus is on a single method 'attribute' which
# behaves much like the built-in 'attr', but whose properties require delving
# deep into the depths of meta-ruby. usage of the 'attribute' method follows
# the general form of
#
# class C
# attribute 'a'
# end
Something went wrong with that request. Please try again.