This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch( 'spec/.*_spec\.rb' ) {|md| system("rspec #{md[0]}") } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_run_a_command_successfully(self): | |
"Run a command successfully" | |
if is_windows(): | |
obj = RunResult("cmd", "/c", "exit 0") | |
else: | |
obj = RunResult("sh", "-c", "exit 0") | |
assert_equal(obj.exitcode, 0) | |
def test_run_a_command_unsuccessfully(self): | |
"Run a command unsuccessfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
echo "Scanning for sqlite databases..." | |
find \ | |
~/Library\ | |
~/Pictures/\ | |
-type f '(' -iname '*.sqlite' -o -iname '*.db' ')' \ | |
-print0 | while read -r -d $'\0' filename; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm_make_flags="-j 10" | |
rvm_install_on_use_flag=1 | |
rvm_gemset_create_on_use_flag=1 | |
export rvm_path="/home/holtje/.rvm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Re-indents buffer. | |
nmap <silent> <Leader>g :call Preserve("normal gg=G")<CR> | |
" Removes all trailing whitespace in buffer. | |
nmap <silent> <Leader><space> :call Preserve("%s/\\s\\+$//e")<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :tools do | |
gem "guard" | |
gem "guard-bundler" | |
gem "guard-rspec" | |
#For detecting changes in the filesystem | |
gem 'rb-inotify', :require => false | |
gem 'rb-fsevent', :require => false | |
#For displaying notices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in /usr/local/opt/vim/bin/*(N) /usr/local/opt/macvim/bin/*(N); do | |
i=$(basename $i) | |
alias "${i}"="env -u GEM_PATH -u GEM_HOME command ${i}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/https' | |
require 'uri' | |
uri = URI.parse "https://www.google.com/" | |
https = Net::HTTP.new uri.host, uri.port | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
begin | |
response = https.get(uri.request_uri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Tracebacks in bash | |
# https://docwhat.org/tracebacks-in-bash/ | |
# | |
# Just take the code between the "cut here" lines | |
# and put it in your own program. | |
# | |
# Written by Christian Höltje | |
# Donated to the public domain in 2013 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# A simple script to troubleshoot SSL problems; notably | |
# a missing CA bundle. | |
# | |
# Example errors that can be troubleshot: | |
# SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
# | |
# Christian Höltje / docwhat.org | |
require 'net/https' |