Skip to content

Instantly share code, notes, and snippets.

View indirect's full-sized avatar

André Arko indirect

View GitHub Profile
### Keybase proof
I hereby claim:
* I am indirect on github.
* I am indirect (https://keybase.io/indirect) on keybase.
* I have a public key whose fingerprint is 53B5 BDD2 6623 41EB 2932 B002 509A E6D4 A089 D900
To claim this, I am signing this object:
@indirect
indirect / gist:c4c9f7fd34b08a8804e5
Created July 31, 2014 03:43
Get list of all gem names from Rubygems
$ gem list --verbose -r
*** REMOTE GEMS ***
GET https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
^CERROR: Interrupted
#!/bin/bash
set -ex
bundle install --standalone
digest=$(md5 -q Gemfile)
cmd="raise \"Gemfile changed\" if %x[md5 -q Gemfile].chomp != \"${digest}\""
echo $cmd > bundle/bundler/setup.rb.new
cat bundle/bundler/setup.rb >> bundle/bundler/setup.rb.new
@indirect
indirect / less_than_proc.rb
Created May 12, 2014 08:34
Subclass proc to add a custom inspect method, add a class method to create a curried instance
class LessThanProc < Proc
attr_accessor :present
def self.with(present)
pv = Gem::Version.new(present.dup)
lt = self.new { |required| pv < Gem::Version.new(required) }
lt.present = present
return lt
end
@indirect
indirect / app.rb
Created March 6, 2014 21:52
Repro case for Ruby 2.0 Content-Disposition: gzip handling
require 'sinatra'
require 'zlib'
configure do
set :server, :puma
end
get '/text' do
body File.read("text")
end
@indirect
indirect / tmux-named
Last active December 28, 2015 13:49
tmux session manager. invoke with `tmux-named NAME` to jump to a set of tmux windows with that name. switch to another session the same way. I suggest changing your Terminal application's "new window" command to `/path/to/tmux-named main`. I also create a bash alias named `mux`, because it's short and easy to type.
#!/bin/bash
# Set up paths and whatnot
test -e ~/.bashrc && source ~/.bashrc
# We need tmux. Obvs.
if [[ -z `which tmux` ]]; then echo "You need tmux first!"; exit 1; fi
# Named variables are much more flexible
name="$1"
@indirect
indirect / iterated_steps.coffee
Created September 28, 2013 03:31
Iterate over an array creating CasperJS steps for each element
casper = require('casper').create()
casper.start 'http://docs.casperjs.org/en/latest/', ->
createWeekStep = (weekNum, index, weeks) ->
@then -> console.log("running step for week #{weekNum}")
(i for i in [1..12]).forEach(createWeekStep, @)
casper.run()
@indirect
indirect / O_O.txt
Created September 27, 2013 21:37
go dependency management
On Mon, Mar 25, 2013 at 3:47 PM, <alexba...@googlemail.com> wrote:
> One thing that does confuse me, is how to specify a specific version of
> someones code? say, their v1.0 or a git commit hash
If you want to do this, the Best Practice method (currently) is to
fork their repo, and maintain your fork at the revision you need.
from https://groups.google.com/forum/#!topic/golang-nuts/t01qsI40ms4
@indirect
indirect / tmux-named
Last active December 23, 2015 15:19
tmux configuration
#!/bin/bash
# I alias this script to `mux`:
# $ alias mux=tmux-named
# Then I tell terminal to automatically attach new windows to my session named "main",
# by setting the preference named "Shells open with" to this command:
# /path/to/tmux-named main
#
# When working on a particular project, I can jump a session for that project
# by running "mux project-name".
@indirect
indirect / .gitignore
Last active December 21, 2015 12:28 — forked from raggi/.gitignore
Rubygems Plaintext Index
specs.4.8
prerelease_specs.4.8
versions.list
names.list
specs
deps
gems
*.sha512