Skip to content

Instantly share code, notes, and snippets.

View patrickskim's full-sized avatar

Patrick Kim patrickskim

View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
## colors ##
txtblk='\033[0;30m' # Black - Regular
txtred='\033[0;31m' # Red
txtgrn='\033[0;32m' # Green
txtylw='\033[0;33m' # Yellow
txtblu='\033[0;34m' # Blue
txtpur='\033[0;35m' # Purple
txtcyn='\033[0;36m' # Cyan
txtwht='\033[0;37m' # White
@patrickskim
patrickskim / docker_help.md
Last active June 13, 2017 17:04
Remove Docker containers & images

List all exited containers

docker ps -aq -f status=exited

Remove stopped containers

docker ps -aq --no-trunc | xargs docker rm This command will not remove running containers, only an error message will be printed out for each of them.

Remove dangling/untagged images

docker images -q --filter dangling=true | xargs docker rmi

@patrickskim
patrickskim / templateEngine.js
Created March 19, 2017 02:53
Simple Templating interview question
class TemplateEngine {
constructor(stringTemplate) {
this.template = stringTemplate;
}
format(props) {
let chunks = this.template.split('<%');
let interped = '';
chunks.forEach((chunk) => {
@patrickskim
patrickskim / gifbin_killer
Last active August 29, 2015 14:02
Remove gifbin from Hipchat
var post_url = "https://giddyapps.hipchat.com/history/room/428265/2014/06/18";
$("a").each(function(){
var str = "" + $(this).attr("href") + ""
if (str.match(/gifb/)) {
var $form = $(this).closest("table").find("form");
$.post(
post_url,
{
action: "delete",
message_id: $form.find("input[name=message_id]").val(),
@patrickskim
patrickskim / base64_cli
Last active August 29, 2015 13:57
Base64 encode file on OSX
openssl base64 -in image.ext -out image_base64.txt
@patrickskim
patrickskim / atom_styles.less
Created March 2, 2014 00:17
atom.io (smaller tabs and line numbers)
// Editor
.editor {
.gutter {
.line-number {
padding: 0 0 0 0.25em;
.icon-right {
padding-right: 0.1em
}