Skip to content

Instantly share code, notes, and snippets.

@teddevaal
teddevaal / gist:394e7f73f2e48b37ec55
Created October 13, 2014 12:27
Execute java with jar
Compile
javac -cp json-20131018.jar Forecast.java
Execute
java -cp json-20131018.jar: Forecast
SSLProtocol -SSLv3
nc IP-ADDRESS PORT < /dev/null; echo $?
@teddevaal
teddevaal / gist:09d64558a43b8fc074b6
Created December 12, 2014 11:31
To watch the contents of a directory change, you could use
watch -d ls -l
@teddevaal
teddevaal / gist:44f5b8c03a84ad4952fd
Created December 19, 2014 12:23
Install ruby 2.0 on yosemite
MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/local/bin/gcc-4.2 rbenv install 2.0.0-p481
@teddevaal
teddevaal / gist:17613b2ec3a5fab7fcd4
Created January 15, 2015 11:46
Cors configuration
Test with curl
curl -H "Origin: http://www.example.nl" \
-H "Access-Control-Request-Method: GET" \
-H "Access-Control-Request-Headers: X-Requested-With" \
-X OPTIONS --verbose \
https://s3-eu-west-1.amazonaws.com/img.example.com.acceptance/public/css/glyphicons-halflings-regular.ttf
S3 Cors configuration
@teddevaal
teddevaal / gist:42db7e0cfb915b2e0b18
Created January 16, 2015 16:24
Clear local host
chrome://net-internals/#dns
@teddevaal
teddevaal / gist:7a83799244ae500c0711
Created January 20, 2015 15:17
set_hostname on unix machine
#!/bin/bash
export PROJECT='PROJECTNAME'
export ENV='ENVIRONMENT'
export HOSTNAME="$PROJECT"-"$ENV"
rm -rf /etc/hostname
echo $HOSTNAME | sudo tee -a /etc/hostname
hostname $HOSTNAME
@teddevaal
teddevaal / gist:d8cf62112442456fa3a0
Last active August 29, 2015 14:16
Rspec caching
spec/features/awesome_cache_sweeper_spec.rb
it 'expires the awesome cache', :with_caching do
perform_your_caching_method
end
spec_helper.rb
config.around(:each, :with_caching) do |spec|
ActionController::Base.perform_caching = true
@teddevaal
teddevaal / gist:2b23658afad5ad439919
Created April 21, 2015 15:03
rbenv install error
RUBY_CONFIGURE_OPTS="--without-gcc --disable-install-rdoc" rbenv install RUBY_VERSION