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
class Foo | |
def done? | |
false | |
end | |
def indirect_done? | |
done? | |
end | |
end | |
describe "Foo#done?" 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
# If you're having cert issues on ruby 2.0.0-p0, the issue is most likely that ruby can't | |
# find the required intermediate certificates. If you built it via rbenv/ruby-build, then | |
# the certs are already on your system, just not where ruby expects them to be. | |
# When ruby-build installs openssl, it installs the CA certs here: | |
~/.rbenv/versions/2.0.0-p0/openssl/ssl/cacert.pem | |
# Ruby is expecting them here: | |
$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE') | |
# Which for me, is this path: |
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
1) Latest brews. | |
$ brew update | |
2) Install packages. | |
$ brew install chruby ruby-install selecta | |
3) Load chruby when the shell inits. | |
echo >> ~/.zshrc | |
if [ -d /usr/local/opt/chruby ]; then | |
. /usr/local/opt/chruby/share/chruby/chruby.sh |
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
class String | |
def normalize | |
mb_chars.normalize(:kd).gsub(/[^\x00-\x7f]/n, '').to_s | |
end | |
def normalize_for_display | |
mb_chars.normalize(:kd). | |
gsub('æ', 'ae'). | |
gsub('ð', 'd'). | |
gsub(/[^\x00-\x7f]/n, '').to_s |
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
{ | |
"auto_complete_commit_on_tab": true, | |
"auto_complete_delay": 30, | |
"bold_folder_labels": true, | |
"caret_style": "wide", | |
"color_scheme": "Packages/User/Ben's Solarized (light).tmTheme", | |
"detect_indentation": false, | |
"detect_slow_plugins": false, | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"drag_text": false, |
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
SELECT DISTINCT comments.id, comments.content_id, comments.created_at -- whatever fields you like | |
FROM comments | |
INNER JOIN ( | |
SELECT comments.id, first_value(comments.id) | |
OVER (PARTITION BY content_id ORDER BY created_at DESC) comment_id | |
FROM comments | |
) chosen | |
ON chosen.comment_id = comments.id |
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
> cabal install --only-dependencies && cabal build | |
Resolving dependencies... | |
All the requested packages are already installed: | |
Use --reinstall if you want to reinstall anyway. | |
setup: Run the 'configure' command first. | |
1 > ./dist/setup/setup configure | |
Configuring Presenter-1.0... | |
setup: At least the following dependencies are missing: | |
FindBin >=0.0.5, |
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
class BabushkaProvisioner < Vagrant::Provisioners::Base | |
class Config < Vagrant::Config::Base | |
attr_accessor :args | |
attr_accessor :deps | |
def initialize | |
@deps = [] | |
end | |
def dep(dep_spec, args = {}) |
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
[ | |
{ "keys": ["super+shift+e"], "command": "use_selection_for_replace"}, | |
{ "keys": ["alt+g"], "command": "next_result"}, | |
{ "keys": ["super+v"], "command": "paste_and_indent"}, | |
{ "keys": ["shift+super+v"], "command": "paste"}, | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
{ "keys": ["super+alt+f"], "command": "replace_next"}, | |
{ "keys": ["super+ctrl+r"], "command": "reveal_in_side_bar"}, |
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
git_current_branch() { | |
cat "$(git rev-parse --git-dir 2>/dev/null)/HEAD" | sed -e 's/^.*refs\/heads\///' | |
} | |
alias gpthis='gp origin $(git_current_branch)' | |
alias gpthis!='gp --set-upstream origin $(git_current_branch)' |
NewerOlder