Fixing Ruby, Python and Node.js packaging on Debian, Redhat and variants.
Canonical URL: http://bit.ly/wtfpackages
You shouldn't be using distribution provided packages for your primary language runtime.
#!/usr/bin/env bash | |
tail -n `wc -l $1 | awk '{ print $1 }'` $1 | gcc -xc - -o ~/.cscript && ~/.cscript |
# ctrl-b -> ctrl-a | |
set -g prefix C-a | |
# ctrl-a ctrl-a last window | |
bind-key C-a last-window | |
# we are humans numbering from 1 | |
set -g base-index 1 | |
# faster input (not waiting for escape) |
Fixing Ruby, Python and Node.js packaging on Debian, Redhat and variants.
Canonical URL: http://bit.ly/wtfpackages
You shouldn't be using distribution provided packages for your primary language runtime.
class TicketsController < ApplicationController | |
def show | |
tickets = params[:tickets].split(",") | |
ticket_data = tickets.map do |ticket| | |
parallel { Faraday.get("http://tickets.local/#{ticket}") } | |
end | |
render json: { tickets: ticket_data.map(&:result) } | |
end |
#!/usr/bin/env ruby | |
gem "parser", "~> 1.4" | |
require "parser" | |
require "parser/ruby19" | |
require "set" | |
class ConstantDeclarationAndUseProcessor < Parser::AST::Processor | |
attr_reader :declared, :used | |
def initialize |
def extension_path_for_nested_extension(path, apply_tmp) | |
if File.exist?(path.gsub(/\.erb$/, "")) | |
if %r{/(locales/.*\.yml)|((routes|#{gem_name})\.rb\.erb)$} === path | |
# put new translations into a tmp directory | |
path = path.split(File::SEPARATOR).insert(-2, "tmp").join(File::SEPARATOR) if apply_tmp | |
elsif %r{/readme.md$} === path || %r{/#{plural_name}.rb$} === path | |
path = nil | |
end | |
elsif %r{lib\/#{plural_name}.rb$} === path | |
path = nil |
def with_retries(timeout = 5.seconds, retry_delay: 0.1.seconds, &blk) | |
start = Time.now | |
begin | |
blk.call | |
rescue | |
if Time.now > start + timeout | |
raise | |
else | |
sleep retry_delay | |
retry |
(defn holdings-manager | |
"Returns a collection of kstreams, one for each different way in which | |
loan ownership state may be updated" | |
[puma-events] | |
(let [ownership-store (k/store "loan-ownership")] | |
(-> (k/kstream puma-events) | |
(k/transform (update-ownership ownership-store)) | |
(k/branch [trade-result? | |
repayment-result?]))]) |
#!/usr/bin/perl | |
use strict; | |
my $rockettop = <<'END'; | |
. | |
/ \ | |
/ \ | |
END |