Skip to content

Instantly share code, notes, and snippets.

$ script/build-osx
+ rm -rf venv
+ virtualenv -p /usr/local/bin/python venv
Running virtualenv with interpreter /usr/local/bin/python
New python executable in venv/bin/python2.7
Also creating executable in venv/bin/python
Installing setuptools, pip, wheel...done.
+ venv/bin/pip install -r requirements.txt
Collecting PyYAML==3.10 (from -r requirements.txt (line 1))
Downloading PyYAML-3.10.tar.gz (241kB)
$ script/build-linux
++ pwd
+ docker run --rm --user=user --volume=/Users/aanand/work/docker/compose:/code --entrypoint=script/build-linux-inner docker-compose
++ pwd
+ mkdir -p /code/dist
++ pwd
+ chmod 777 /code/dist
+ pyinstaller -F bin/docker-compose
18 INFO: wrote /code/docker-compose.spec
36 INFO: UPX is not available.
[aanand ~/src/boomtrapezoid (master)]$ git bisect start
[aanand ~/src/boomtrapezoid (master)]$ git bisect bad
[aanand ~/src/boomtrapezoid (master)]$ git bisect good 4bcda121df9c5d657032e6d1be9ac7c7b0f05935
Bisecting: 2 revisions left to test after this
[51673093722233086a5765fab0b00008a9eda2de] Refactored gun related code into Gun.scala as Tank.scala was getting pretty crowded.
[aanand ~/src/boomtrapezoid (bisect)]$ rake run
(in /Users/aanand/src/boomtrapezoid)
fsc -deprecation -classpath lib/scala-library.jar:lib/slick.jar:lib/phys2d.jar:lib/lwjgl.jar:lib/sbinary.jar:lib/jogg.jar:lib/vorbisspi.jar:lib/jorbis.jar:lib/tritonus_share.jar:lib/natives-linux.jar:lib/natives-mac.jar:lib/natives-win32.jar src/**.scala -d classes
java -classpath classes:lib/scala-library.jar:lib/slick.jar:lib/phys2d.jar:lib/lwjgl.jar:lib/sbinary.jar:lib/jogg.jar:lib/vorbisspi.jar:lib/jorbis.jar:lib/tritonus_share.jar:lib/natives-linux.jar:lib/natives-mac.jar:lib/natives-win32.jar -Djava.library.path=lib/natives-mac Main
Mon
# see http://nullroute.eu.org/mirrors/analogliterals/analogliterals.xhtml
module AnalogLiterals
class A < Struct.new(:dashes, :tildes, :pluses, :els)
def -@; A.new(dashes+1, tildes, pluses, els); end
def ~@; A.new(dashes, tildes+1, pluses, els); end
def +@; A.new(dashes, tildes, pluses+1, els); end
def -x; A.new(dashes+x.dashes+1, tildes+x.tildes, pluses+x.pluses, els+x.els); end
def +x; A.new(dashes+x.dashes, tildes+x.tildes, pluses+x.pluses+1, els+x.els); end
sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby
sudo ln -s /usr/bin/ri1.8 /usr/bin/ri
sudo ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc
sudo ln -s /usr/bin/irb1.8 /usr/bin/irb
def multipart_request url, env
m = Merb::Test::MultipartRequestHelper::Post.new(env.delete(:params))
body, head = m.to_multipart
mp_env = {
:method => 'POST',
'CONTENT_TYPE' => head,
'CONTENT_LENGTH' => body.length,
:input => body
}
# Hook for storing the dimensions of uploaded images.
#
# Use like this:
#
# class MyModel
# has_attached_file :image, :styles => { :thumb => '72x72#' }
#
# stores_dimensions :image
# end
#
I'm using DataMapper 0.9.10 and data_objects 0.9.11.
When I have two chained one-to-many associations, e.g. Author -> Post -> Comment,
trying to fetch associated Comments on a Post which has *itself* been fetched
from an Author results in some strange SQL being generated and some incorrect behaviour.
Here, I create a single Author, two Posts attached to that Author, and one
Comment associated with each Post, with a :name of "foo", to give us something to
search on. Then I try to retrieve the Comment for the Post with id=2.
#!/bin/bash
set -o errexit
BRANCH=$(git branch | grep '*' | awk '{ print $2; }')
git fetch
for branch in $(ls .git/refs/heads)
do
GET 200 OK: http://staging.rubygems.org/specs.4.8.gz
GET 200 OK: http://staging.rubygems.org/quick/Marshal.4.8/gemcutter-0.1.4.gemspec.rz
Downloading gem gemcutter-0.1.4.gem
GET 302 Moved Temporarily: http://staging.rubygems.org/gems/gemcutter-0.1.4.gem
GET 200 OK: http://s3.amazonaws.com/gemcutter_staging/gems/gemcutter-0.1.4.gem
Downloaded gemcutter-0.1.4