Skip to content

Instantly share code, notes, and snippets.

Avatar
👯‍♀️
OMG

Ian Vaughan IanVaughan

👯‍♀️
OMG
View GitHub Profile
@IanVaughan
IanVaughan / docker-cleanup-resources.md
Created Aug 18, 2017 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

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
View gist:0ac24c2cf7ea3bbe8081749680a661b6
* Pull & rebase on master (interactively), force push to origin
* Cherry pick multiple commits from another branch
*
@IanVaughan
IanVaughan / curl.md
Last active Aug 29, 2015 — forked from btoone/curl.md
A curl tutorial using GitHub's API
View curl.md

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
@IanVaughan
IanVaughan / after.sh
Last active Sep 11, 2018 — forked from justincampbell/after.sh
Jenkins + GitHub Commit Status API
View after.sh
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 \
View gist:5554234

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)
View application_helper.rb
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
View application_helper.rb
def path_to_attachment_image(attachment)
image_path("attachments/#{attachment.filename}")
end