Skip to content

Instantly share code, notes, and snippets.

View driv3r's full-sized avatar
😈

Leszek Zalewski driv3r

😈
View GitHub Profile
@driv3r
driv3r / rvm-rubyinstall
Created December 12, 2011 23:43
Download hangout
Installing Ruby from source to: /home/driv3r/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...
ruby-1.9.3-p0 - #fetching
ruby-1.9.3-p0 - #downloading ruby-1.9.3-p0, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0
21 9330k 21 1997k 0 0 2035 0 1:18:15 0:16:45 1:01:30 0^CERROR: There was an error, please check /home/driv3r/.rvm/log/ruby-1.9.3-p0/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
@driv3r
driv3r / gist:1475171
Created December 14, 2011 03:44
Ruby/Gstreamer error
require 'gst'
unless ARGV.length == 1
$stderr.puts "Usage: #{__FILE__} <mp3 filename>"
exit 1
end
# create a new pipeline to hold the elements
pipeline = Gst::Pipeline.new
@driv3r
driv3r / Gemfile
Created January 20, 2012 14:17
Guardfile for rails app with spork and rspec with livereload
gem "guard", require: false
gem "guard-rspec", require: false
gem "guard-spork", require: false
gem "guard-livereload", require: false
gem "rb-inotify", require: false # for guard on Linux
gem "libnotify", require: false # for guard-rspec notifications
@driv3r
driv3r / Gemfile
Created September 24, 2012 19:00
sidekiq error
source 'http://rubygems.org'
gem 'rails'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'sidekiq'
gem 'sinatra'
@driv3r
driv3r / ruby-build.20130808125730.21992.log
Created August 8, 2013 13:11
Crash while trying to run `rbenv install rbx-2.0.0-dev` inside chef recipe. It waits for user input `y` for gems like rake, rdoc, ri and others which are in preinstall-gems.
/tmp/ruby-build.20130808125730.21992/rubinius-2.0.0-dev/staging/bin/rbx /tmp/ruby-build.20130808125730.21992/rubinius-2.0.0-dev/rakelib/preinstall_gems.rb
Pre-installing gems for 1.9.3...
An exception occurred running /tmp/ruby-build.20130808125730.21992/rubinius-2.0.0-dev/rakelib/preinstall_gems.rb
"rake" from rake conflicts with /tmp/ruby-build.20130808125730.21992/rubinius-2.0.0-dev/staging/bin/rake (Gem::InstallError)
Backtrace:
Gem::Installer#check_executable_overwrite at staging/lib/rubygems
/installer.rb:175
{ } in Gem::Installer#generate_bin at staging/lib/rubygems/installer.rb:375
Array#each at kernel/bootstrap/array.rb:68
@driv3r
driv3r / stack_trace
Created September 17, 2013 11:15
rbx failure when running `defined?(__ENCODING__)`
An exception occurred running /home/travis/.rvm/gems/rubinius-2.0.0-weekly20130906-d19@global/gems/rake-10.1.0/lib/rake/rake_test_loader.rb
/home/travis/build/driv3r/simple-rss/lib/simple-rss/parser.rb:3: defined? passed an unrecognized expression (Exception)
Backtrace:
 Rubinius.unrecognized_defined at kernel/delta/rubinius.rb:242
Object#__script__ at lib/simple-rss/parser.rb:3
 Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
 Kernel(Object)#require at kernel/common/kernel.rb:635
Object#__script__ at lib/simple-rss.rb:5
 Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
@driv3r
driv3r / README.md
Last active June 26, 2018 18:12
Elixir design and testing patterns

Setup

Application consist of 3 servers:

  • Queue, for fetching/deleting messages from the queue
  • Token, for fetching access token required for other service
  • Cron, for republishing messages from queue to 3rd party service by using access token authentication

Each of the HTTPoison calls are supposed to be replaced by proper Endpoints which could have used @behaviour and have an Http implementation, that could be set via application configuration and tested with mox.

@driv3r
driv3r / kv.exs
Created March 11, 2019 12:17
Going functional with elixir & otp
defmodule KV do
@moduledoc """
Key value store.
## Examples
Basic usage
iex> {:ok, pid} = KV.start_link()
iex> KV.put(pid, "foo", :bar)