View config-initializers-siginfo.rb
# Send a process a SIGINFO like `kill -INFO <pid>` and it will print the
# current backtrace of all threads.
Signal.trap(29) do
puts "Thread dump:"
Thread.list.each do |thread|
puts thread.inspect.indent(2)
puts thread.backtrace.join("\n").indent(4)
end
end
View buildkite-agent.service
[Unit]
Description=Buildkite Agents
Documentation=https://buildkite.com/agent
Wants=buildkite-agent@1.service
Wants=buildkite-agent@2.service
# ...
[Service]
Type=oneshot
ExecStart=/bin/true
View main.go
package main
import _ "github.com/ErikDubbelboer/gspt"
func main() {
}
View Gemfile
source "https://rubygems.org"
gem "unicode-display_width"
View mailcatcher-rvm-test.sh
docker run -it ubuntu /bin/bash
apt-get update -y
apt-get install -y curl build-essential libgmp-dev libpq-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s 1.26.11 --ruby=2.3.0
source /etc/profile.d/rvm.sh
rvm use 2.3.0@gemset --create
gem install --no-rdoc --no-ri \
aasm:4.7.0 \
View a.rb
#!/usr/bin/env ruby -I.
class A
end
class A::B
end
class B
end
View weirdness.rb
require "rspec/autorun"
require "rspec/mocks"
require "active_support/all"
RSpec.describe "presence" do
specify { expect(spy).to be_present }
end
#
# Failures:
View config-initializers-dalli-unwrap-and-raw-read.rb
# By default, DalliStore doesn't deal with `raw` correctly when inside the
# LocalCache per-request middleware. The MemCacheClient fixes this already by
# adding another little module. Let's do the same.
#
# A PR has been lodged upstream:
#
# https://github.com/mperham/dalli/pull/481
#
# Once merged @sj26 will update dalli and remove this workaround.
if defined? ActiveSupport::Cache::DalliStore and Rails.cache.is_a? ActiveSupport::Cache::DalliStore
View wkhtmltopdf.rb
require 'formula'
class Wkhtmltopdf < Formula
homepage 'http://wkhtmltopdf.org/'
url 'http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_osx-cocoa-x86-64.pkg'
version '0.12.2'
def install
`cat Payload | gzip -d - | cpio -id`
`tar -xvf usr/local/share/wkhtmltox-installer/app.tar.xz`
View wkhtmltopdf.rb
require 'formula'
class Wkhtmltopdf < Formula
homepage 'http://code.google.com/p/wkhtmltopdf/'
url 'https://launchpad.net/ubuntu/+archive/primary/+files/wkhtmltopdf_0.9.0.orig.tar.gz'
sha256 '628363a79c82eb835e436cd62bce1b7323aed4e707affe57c3248e337a3ed18b'
version '0.9.0'
depends_on 'qt'