Skip to content

Instantly share code, notes, and snippets.

View IanVaughan's full-sized avatar
👯‍♀️
OMG

Ian Vaughan IanVaughan

👯‍♀️
OMG
View GitHub Profile
def path_to_attachment_image(attachment)
image_path("attachments/#{attachment.filename}")
end
module ApplicationHelper
# Access Levels
ACCESS_LEVELS = { :private => 0, :friends => 1, :public => 2 }
# Access levels i18n translation
def access_levels
ACCESS_LEVELS.collect{|k,v| [I18n.t("access." + k.to_s), v]}
end
end

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘⇧P command prompt
⌃ ` python console
⌘⇧N new window (useful for new project)
@IanVaughan
IanVaughan / after.sh
Last active September 11, 2018 05:18 — forked from justincampbell/after.sh
Jenkins + GitHub Commit Status API
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \
-H "Content-Type: application/json" \
-X POST \
@IanVaughan
IanVaughan / curl.md
Last active August 29, 2015 14:28 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
* Pull & rebase on master (interactively), force push to origin
* Cherry pick multiple commits from another branch
*
@IanVaughan
IanVaughan / docker-cleanup-resources.md
Created August 18, 2017 20:56 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm