Skip to content

Instantly share code, notes, and snippets.

View starkcoffee's full-sized avatar

Duana Saskia starkcoffee

View GitHub Profile
@starkcoffee
starkcoffee / gist:dd926ad4acbefdf51f69
Created June 24, 2014 23:11
Restarting mysql on mac, resetting root password
> mysql.serverstop --skip-grant-tables
> mysql
mysql> UPDATE mysql.user SET Password=PASSWORD('PASSWORD') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
> mysql.server stop
> mysql.server start
Sources:
http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew

RailsGirls Summer of Code Fundraising Workshop Tomorrow!

Help us brainstorm ideas, or hack an app to raise funds so that more women can do the amazing Summer of Code this year!

When: Saturday (tomorrow!), April 12th, 11h - 15h

Where: see below!

The Travis CI office

@starkcoffee
starkcoffee / gist:5025548
Last active December 14, 2015 04:08
vim run current and last spec file, and run current spec for line number
function! RunSpec(lineNumber)
wall
let lineNumberSpecified = a:lineNumber
let fname = expand("%")
if fname =~ "spec"
let g:spec = fname
let g:specLineNum = a:lineNumber
endif
if exists("g:spec")
let cmd = '!./script/spin ' . g:spec
@starkcoffee
starkcoffee / gist:2838545
Created May 30, 2012 19:50
command line script uri en/de-code
uri_decode () {
ruby -e "require 'uri'; puts URI.decode '$1'"
}
uri_encode () {
ruby -e "require 'uri'; puts URI.encode '$1'"
}
@starkcoffee
starkcoffee / gist:2727359
Created May 18, 2012 20:09
git precommit hook to warn about ruby puts statements
# thanks to http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/
FILES_PATTERN='\.rb'
FORBIDDEN='puts '
git diff --cached --name-only | \
grep -E $FILES_PATTERN | \
GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n $FORBIDDEN && \
echo 'COMMIT REJECTED Found "$FORBIDDEN" references. Please remove them before commiting' && \
exit 1
@starkcoffee
starkcoffee / gist:1267990
Created October 6, 2011 17:14
simple GET and access response with httparty
require 'rubygems'
require 'httparty'
require 'uri'
url = 'http://something.com'
options = { :http_proxyaddr =>'proxy.com' , :http_proxyport => 8080 }
response = HTTParty.get url ,options
puts url, response.code
@starkcoffee
starkcoffee / gist:818018
Created February 9, 2011 06:23
A script to analyse your vodafone bill (if you download the bill as csv)
if ARGV.length != 1
p "Provide a vodafone csv file you donkey!"
exit 666
end
file = open(ARGV[0], 'r').read
# isolate the csv part of the vodafone data file... multiline regex match FTW!!!
BEGIN_MARKER="Call details for.*?\n"
END_MARKER=",,,,,"
@starkcoffee
starkcoffee / gist:815957
Created February 8, 2011 05:55
bash function to kill unnecessary intermediary directories
# kill unnecessary intermediary directories
# requires shopt -s dotglob to move hidden files
function kid() {
if [ -z "$1" ]; then
echo "Provide a directory you donkey"
return
fi
mv $1/* .
rmdir $1
}