Skip to content

Instantly share code, notes, and snippets.

View Vaysman's full-sized avatar

Mikhail Vaysman Vaysman

  • SkyWorkz
  • Hilversum
View GitHub Profile
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package TestFirst;
import java.util.ArrayList;
import java.util.List;
/**
@Vaysman
Vaysman / readfile.vb
Created March 18, 2011 16:02
read binary file on vb 6
Dim iFile As Integer
Dim lByteLen As Long
Dim bytData As Byte
Dim bytArray() As Byte
Dim sHex As String
'get an available file ID
iFile = FreeFile
'open the file for access
@Vaysman
Vaysman / metakoans.rb
Created May 12, 2011 07:11
Matakoans by ara.t.howard
#
# 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
@Vaysman
Vaysman / README.md
Created May 16, 2011 08:58 — forked from ryanb/README.md
My Github Issues

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
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
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
@Vaysman
Vaysman / s.rb
Created April 11, 2012 07:33 — forked from jacksonwillis/s.rb
Sentences as Ruby code
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! #####
@Vaysman
Vaysman / 0-readme.md
Created June 19, 2012 09:18 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

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.

@Vaysman
Vaysman / Gemfile
Created December 6, 2012 01:28
Simple app with cookie
source :rubygems
gem 'sinatra'
gem 'sinatra-contrib'