This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| brew install apple-gcc42 openssl libyaml libffi | |
| xcode-select --install | |
| export CC=/usr/local/bin/gcc-4.2 | |
| export CFLAGS='-g -O2' | |
| export RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` | |
| export CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` | |
| # I had to edit the svn repo URL in /usr/local/Cellar/ruby-build/20160913/share/ruby-build/1.8.7-p375 and change the URL from http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7 to https://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7 | |
| rbenv install 1.8.7-p375 |
replays last FIN-ACK in order to check if the other side correctly implements TIMED-WAIT. other side should be first to close the connection. with http this can be done in curl by forcing http/1.0 mode.
curl -0 -d 'lolol=lololol' http://TARGET/wtwtwt
tcpdump -S 'tcp port 80' -l | ./replayer.rb TARGET 80 YOUR_HOST_AS_APPEARS_IN_TCPDUMP
Example of it working and showing the other side correctly handling TIMED-WAIT:
root@midway:~# tcpdump -S 'tcp port 80' -l | ./replayer.rb 173.194.41.67 80 ip-10-250-157-181.eu-west-1.compute.internal
OMG IM RUNNING
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
| var request = require('request'), default_headers, site_root = 'http://localhost:3000';; | |
| default_headers = { | |
| 'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1', | |
| 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', | |
| 'Accept-Language': 'en-us,en;q=0.5', | |
| 'Accept-Encoding': 'gzip, deflate', | |
| 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', | |
| // 'Connection': 'keep-alive', | |
| 'Cache-Control': 'max-age=0' |
This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo
bundle installmate Guardfilebundle exec jasmine initmate spec/support/yasmine.ymbundle exec guard| gem 'devise', '1.5.0' | |
| gem 'omniauth-facebook', :git => "git://github.com/mkdynamic/omniauth-facebook.git" | |
| gem 'rspec-rails', :group => [:development, :test] | |
| group :test do | |
| # Pretty printed test output | |
| gem 'turn', '< 0.8.3', :require => false | |
| gem 'cucumber-rails' | |
| gem 'capybara' |
| Original Source: https://github.com/chneukirchen/styleguide | |
| = Christian Neukirchen's Ruby Style Guide | |
| You may not like all rules presented here, but they work very well for | |
| me and have helped producing high quality code. Everyone is free to | |
| code however they want, write and follow their own style guides, but | |
| when you contribute to my code, please follow these rules: | |
| #!/usr/bin/env ruby | |
| class MRISC | |
| def run(code) | |
| tokens = code.gsub(/(\*.*?\*)|[^a-z0-9,-;@\._]/,'').split(';') | |
| @vars,stack,i = {:_pc=>-1,:_oc=>0},[],0 | |
| tokens.map!{|t| t.chars.first=='@' ? (@vars[t.to_sym]=i-1;nil) : (i+=1;t.split(',').map{|e|numeric?(e) ? e.to_i : e.to_sym})}.compact! | |
| while @vars[:_pc] < tokens.size-1 | |
| @vars[:_pc] += 1 | |
| @vars[:_oc] += 1 |
| tell application "System Preferences" | |
| set current pane to pane "com.apple.preference.keyboard" | |
| end tell | |
| tell application "System Events" | |
| -- If we don't have UI Elements enabled, then nothing is really going to work. | |
| if UI elements enabled then | |
| tell application process "System Preferences" | |
| get properties | |