Skip to content

Instantly share code, notes, and snippets.

View g3d's full-sized avatar
🚀
To the moon!

Bohdan V. g3d

🚀
To the moon!
View GitHub Profile
@g3d
g3d / gist:2709563
Last active February 7, 2024 15:21 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@g3d
g3d / ruby-1.9.3-p125
Created October 22, 2012 14:31
ruby-1.9.3-p125 vc ruby-1.9.3-p286-perf
bvar@ubuntu [04:31:38] [~/Code/App] [master]
-> % env RAILS_ENV=test bundle exec time rspec
Finished in 21 minutes 18.03 seconds
2307 examples, 38 failures
872.68user 170.66system 22:21.75elapsed 77%CPU (0avgtext+0avgdata 990436maxresident)k
215616inputs+1379624outputs (735major+2542714minor)pagefaults 0swaps
@g3d
g3d / README.md
Created October 25, 2012 15:04 — forked from agnoster/README.md
My ZSH Theme

agnoster-ruby.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@g3d
g3d / netsed.rb
Created November 18, 2012 10:20
Netsed homebrew formula
require 'formula'
class Netsed <Formula
url 'http://silicone.homelinux.org/release/netsed/netsed-1.1.tar.gz'
homepage 'http://www.securiteam.com/tools/5IP022A35W.html'
version '1.1'
md5 'df64a6099370013621489c60fe97a324'
def install
system "make"
@g3d
g3d / .pryrc
Created February 13, 2013 15:04
Some Espresso improvement
require File.expand_path('../base/boot', __FILE__)
@g3d
g3d / gist:5019043
Last active December 14, 2015 03:09
self referential m:m relationships
class Category
include DataMapper::Resource
property :id, Serial
# some other properties here
has n, :user_children, 'Categoryship', child_key: [ :source_id ]
has n, :user_parents, 'Categoryship', child_key: [ :target_id ]
has n, :children, self, through: :user_children, via: :target
@g3d
g3d / rtf-filter.rb
Last active December 18, 2015 11:58
RTF Filter homebrew formula
require 'formula'
class RtfFilter <Formula
url 'https://github.com/g3d/rtf-filter/archive/v2.1.3.zip'
homepage 'https://github.com/leanbid/rtf-filter'
version '2.1.3'
md5 '1a1197babbdb4fbff503408a680699dc'
depends_on 'boost'
1.9.1 :003 > exit
/home/bookstore/.rvm/scripts/irbrc.rb:32: [BUG] Segmentation fault
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0005 p:---- s:0014 b:0014 l:000013 d:000013 CFUNC :initialize
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :open
c:0003 p:0140 s:0007 b:0007 l:0012a0 d:000006 BLOCK /home/bookstore/.rvm/scripts/irbrc.rb:32
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000c38 d:000c38 TOP
@g3d
g3d / gist:6ce15fb55ec6db8a60c3
Last active August 29, 2015 14:17
xlsx parsing in ruby
XLSX file, 1.5 Mb, 10 000 rows
==================================
Benchmark.measure { ::Creek::Book.new(import.import_file.read.path).sheets.first.rows.first }
<Benchmark::Tms:0x0000010eb1b200
@cstime=0.0,
@cutime=0.0,
@label="",
@real=83.360489,
@g3d
g3d / category.rb
Created June 7, 2015 17:27
lotus uuid example
class Category
include Lotus::Entity
# id is implicit
attributes :name, :slug, :created_at, :updated_at
end