Skip to content

Instantly share code, notes, and snippets.

echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' |
xmllint --format -
@teddevaal
teddevaal / gist:c87017110b9fb28c7425
Created November 11, 2015 15:08
Fix subtree conflict
git filter-branch --index-filter 'git rm --cached --ignore-unmatch -rf directory/of/subtree' --prune-empty -f HEAD
git subtree add --prefix directory/of/subtree git@github.com:repository.git branch --squash
openssl rsa -noout -modulus -in *.key
openssl x509 -noout -modulus -in *.crt
for file in `ls *.zip` ; do 7z x $file < password.file ; done
@teddevaal
teddevaal / gist:92a74ae6828b93d315bf
Last active August 29, 2015 14:20
windows tls regedit
command prompt
regedit
Go to the following directory:
HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Control>SecurityProviders>SCHANNEL>Protocols
@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
@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: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:42db7e0cfb915b2e0b18
Created January 16, 2015 16:24
Clear local host
chrome://net-internals/#dns
@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