Skip to content

Instantly share code, notes, and snippets.

Avatar

Srdjan Pejic batasrki

View GitHub Profile
View warning
udio:<flvdemux0> failed pushing a 289 bytes audio buffer: not-linked
0:01:02.593179039 2738 0xb35630 WARN flvdemux gstflvdemux.c:1185:gst_flv_demux_parse_tag_audio:<flvdemux0> failed pushing a 263 bytes audio buffer: not-linked
0:01:02.626633307 2738 0xb35630 WARN flvdemux gstflvdemux.c:1185:gst_flv_demux_parse_tag_audio:<flvdemux0> failed pushing a 269 bytes audio buffer: not-linked
@batasrki
batasrki / also_works_not.json
Last active Dec 20, 2015
Mandrill API brokenness
View also_works_not.json
{
"template_name": "verification",
"template_content": null,
"merge_vars": [
{
"vars": [
{
"name": "name",
"content": "Test Me"
},
@batasrki
batasrki / cli
Created Jun 21, 2013
Starting Nailgun breaks if JRUBY_OPTS is set
View cli
# in .zshrc, I got the following
export JRUBY_OPTS=--1.9
→ jruby --ng-server
Exception in thread "main" java.net.UnknownHostException: --1.9: nodename nor servname provided, or not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
at java.net.InetAddress.getAllByName0(InetAddress.java:1239)
at java.net.InetAddress.getAllByName(InetAddress.java:1155)
@batasrki
batasrki / Gemfile
Last active Dec 18, 2015
Gemfile and Gemfile.lock
View Gemfile
ruby '1.9.3', :engine => 'jruby', :engine_version => '1.7.3'
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'rails-api'
gem 'active_model_serializers'
gem 'activerecord-jdbcpostgresql-adapter', '~>1.3.0.beta2'
gem 'puma'
@batasrki
batasrki / stack-trace
Last active Dec 18, 2015
Stack trace
View stack-trace
NotImplementedError: kill unsupported or native support failed to load
kill at org/jruby/RubyProcess.java:1000
kill at org/jruby/RubyProcess.java:907
stop at /opt/boxen/rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rb-fsevent-0.9.3/lib/rb-fsevent/fsevent.rb:53
stop at /opt/boxen/rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/listen-1.2.2/lib/listen/adapter.rb:122
works? at /opt/boxen/rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/listen-1.2.2/lib/listen/adapter.rb:238
usable_and_works? at /opt/boxen/rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/listen-1.2.2/lib/listen/adapter.rb:190
all? at org/jruby/RubyEnumerable.java:1303
usable_and_works? at /opt/boxen/rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/listen-1.2.2/lib/listen/adapter.rb:190
__send__ at org/jruby/RubyBasicObject.java:1689
@batasrki
batasrki / Vagrantfile.rb
Created May 23, 2013
Forward porting in vagrant
View Vagrantfile.rb
Vagrant.configure("2") do |cluster|
(1..NODES).each do |node_number|
cluster.vm.define "node#{node_number}".to_sym do |config|
config.vm.network :private_network, ip: "33.33.33.#{node_number}"
config.vm.network :forwarded_port, guest: 8098, host: "809#{node_number}".to_i
end
end
end
@batasrki
batasrki / gist:1670983
Created Jan 24, 2012 — forked from wmoxam/gist:1569088
Ubuntu Way of managing Rubies
View gist:1670983
# Installs Ruby, makes 1.9.2 the default.
sudo aptitude install ruby rubygems ri ruby1.9.1 ri1.9.1 jruby
sudo update-alternatives --remove-all gem
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 300 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/share/man/man1/ruby1.8.1.gz \
View Gemfile
source :rubygems
path '/Users/bkerley/Documents/ripple' do
gem 'riak-client'
gem 'ripple'
end
View possibly_evil.rb
describe Something do
before do
@mock_view = mock("rails view")
proc_thing = @mock_view.stub(:content_tag).with(:span).and_return("<span></span>")
@mock_view.stub(:content_tag).with(:div).and_yield.and_return("<div>#{proc_thing.call}</div>")
end
it "should return a span inside a div" do
Something.new(@mock_view).render_custom_block.should match /\<div\>\<span\>\<\\span\>\<\\div\>/
end
View json_builder.rb
###
# This is a JSON building library. It allows you to build data structures
# to dump as JSON. Here is a sample of how to use it:
#
# def person_hash(person)
# {
# 'name' => person.name,
# 'age' => person.age,
# 'friends' => person.friends.map { |x| person_hash x }
# }