Skip to content

Instantly share code, notes, and snippets.

@ciaranarcher
ciaranarcher / output.txt
Created June 5, 2013 20:21
Heroku Lineman Build Details
ember-movies master$ git push heroku master
Counting objects: 384, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (346/346), done.
Writing objects: 100% (384/384), 728.08 KiB | 329 KiB/s, done.
Total 384 (delta 150), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Lineman app detected
@ciaranarcher
ciaranarcher / sublime_shortcuts.md
Last active February 18, 2016 08:25
Sublime Text 2 Shortcuts
We couldn’t find that file to show.

Some vim-go tips

  • gd jumps to the definition of a type, variable
  • C-t jumps you back to where you where.
  • Use <tab> to autocomplete snippets in insert mode. Example snippets.
  • :A open alternate (i.e. test for current file). Also :AH and :AV for horizontal and vertical splits.
  • gt will run the tests for the current file.
  • :GoDeclsDir will show all functions in current directory.
  • K open GoDoc for symbol under the cursor.
  • <leader>i over a function or method name will show function information.
  • c will run GoCoverage for the current file.
@ciaranarcher
ciaranarcher / .my.cnf
Created April 16, 2013 08:21
Sample MySQL Configuration Example
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
@ciaranarcher
ciaranarcher / .rvmrc
Created April 15, 2013 08:32
Example `.rvmrc` file
rvm 1.9.3-p327; rvm gemset use ciaran_gemset
@ciaranarcher
ciaranarcher / gist:5151631
Last active December 14, 2015 21:29
Redis Stuff
redis_client.set('ciaran_key', [:hi, :there].to_json)
>> OK
JSON.parse(redis_client.get('ciaran_key'))
>> ["hi", "there"]
redis_client.del('ciaran_key')
>> 1
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@ciaranarcher
ciaranarcher / spec_helper.rb
Created November 25, 2012 19:54
Stubbing Helper
def stub_save!(obj)
obj.stub(:save!).and_return true if obj.respond_to? :save!
end
@ciaranarcher
ciaranarcher / vhosts.sh
Created October 10, 2012 10:33
vhosts investigation
# create list of hosts
cat content_vhosts.conf | grep ServerName | awk '{ print $2 }' | sort >> sorted_hosts.txt
# health check for each
# use cntlm proxy, max op time of 5s
for host in `cat sorted_hosts.txt`
do
curl -sLk -x http://localhost:3128 -m 5 -w "$host : %{url_effective} %{http_code} in %{num_redirects} redirs\\n" $host -o /dev/null
done