Update 8/16/2015: I updated this guide a bit and posted it to Medium
A few notes about things I do when I travel to Japan.
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
Update 8/16/2015: I updated this guide a bit and posted it to Medium
A few notes about things I do when I travel to Japan.
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
system ~/projects/jruby $ time java HelloWorld | |
Hello, world! | |
real 0m0.098s | |
user 0m0.087s | |
sys 0m0.022s | |
system ~/projects/jruby $ time java HelloWorld | |
Hello, world! |
Recently I’ve become disillusioned with the state of the JVM IDE: I haven’t touched Eclipse in anger in 3 years, and have no intention to do so anytime soon. IntelliJ on the other hand has served me decently, but suffers from too many odd bugs when dealing with Scala code to not be a minor nuisance in my workflow. Not only that, “modern” IDE’s are massive workspace hogs: try working with IntelliJ without at least a 1920x1200 resolution screen. | |
For these reasons, I’ve decided to try using Emacs for development for a month or so to see how it compares, and so far, so good. | |
Setting Up Emacs for Scala Development | |
Setting up Emacs for Scala development is fairly easy, just do the following: | |
Create a folder called ~/.emacs.d/scala-mode (in your home folder). You might already have an .emacs.d folder there, if not, create it. | |
Copy all contents from $SCALA_HOME/misc/scala-tool-support/emacs into ~/.emacs.d/scala-mode. I found that this folder is missing in the latest Scala 2.9.2 distribution, but you can get it from |
require 'active_record' | |
require 'benchmark/ips' | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => ':memory:') | |
ActiveRecord::Base.connection.create_table('posts') do |t| | |
t.string :name | |
t.timestamps |
group :assets do | |
#gem 'sass-rails', '~> 3.1.4' | |
#gem 'coffee-rails', '~> 3.1.1' | |
#gem 'uglifier', '>= 1.0.3' | |
gem 'less', :git => 'git://github.com/kares/less.rb.git', :submodules => true | |
gem 'less-rails', '>= 2.2.1' | |
gem 'less-rails-bootstrap' # optional | |
gem 'therubyracer', :platforms => :ruby |
#!/bin/bash | |
ssh-add | |
ssh $1 "mkdir -p .ssh && touch .ssh/authorized_keys && echo `ssh-add -L` >> .ssh/authorized_keys" | |
# keep this file in the PATH. like in /usr/bin. |
web: node app.js | |
worker: node consumer.js |
$ jruby --server is_prime.rb | |
"jruby 1.7.0.dev (ruby-1.8.7-p330) (2011-09-23 2b786ba) (Java HotSpot(TM) Server VM 1.6.0_26) [darwin-i386-java]" | |
user system total real | |
100K primes 8.003000 0.000000 8.003000 ( 7.967000) | |
user system total real | |
100K primes 7.742000 0.000000 7.742000 ( 7.742000) | |
user system total real | |
100K primes 7.950000 0.000000 7.950000 ( 7.950000) | |
user system total real | |
100K primes 7.977000 0.000000 7.977000 ( 7.977000) |