Skip to content

Instantly share code, notes, and snippets.

View rex's full-sized avatar

ᴘɪᴇʀᴄᴇ ᴍᴏᴏʀᴇ™ rex

View GitHub Profile
@rex
rex / aws.zsh
Created May 2, 2014 17:07
AWS Shell One-Liners
#!/bin/zsh
# Determine the instance ID of the current instance
ec2-metadata | awk '/instance-id:/ {print $2}'
# Determine the 'type' of an instance based on the tags applied to it.
ec2-describe-tags | grep $(ec2-metadata | awk '/instance-id:/ {print $2}') | awk '/type/ {print $5}'
@rex
rex / remove_node.sh
Created June 17, 2014 22:23
One-liner to completely remove Node.js and NPM from a machine, as per https://github.com/joyent/node/issues/4058#issuecomment-9204752
sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}
@rex
rex / BrandonsWay.php
Last active August 29, 2015 14:03
S3 Migration Script Challenge
<?php
/*
* Copyright 2013. Amazon Web Services, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@rex
rex / Texas-Rangers-emblem.json
Created July 28, 2014 10:19
Texas Rangers baseball team emblem for Battlelog, for use with Battlefield 3, 4+
{
"objects": [{
"asset": "Triangle",
"left": 115,
"top": 291,
"angle": 62.374397494326026,
"width": 31.24619059107534,
"height": 31.24619059107534,
"opacity": 1,
"fill": "#E2020D",
@rex
rex / Uninstall-Node.sh
Created August 5, 2014 11:16
Completely uninstall Node.js and NPM from a Mac/*Nix machine
sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}
@rex
rex / .editorconfig
Created August 5, 2014 13:20
My standard editor configuration file
root = true
# Global defaults
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
charset = utf-8
@rex
rex / .gitignore
Created August 5, 2014 13:26
Cure-all .gitignore = happy
.DS_Store
thumbs.db
node_modules/
bower_components/
.sass-cache/
.cap-tasks~
*.tmp
.env
*.env.*
@rex
rex / this-is-how-we-do-it.rb
Created November 21, 2014 22:39
This is how we do it. Shell style.
#!/usr/bin/env ruby
# names = `say -v ? | awk '{print $1}'`
# names_array = names.split(/\n/)
# names_array.each do |name|
# puts " > #{name}"
# `say #{name} -v #{name}`
# end
@rex
rex / rex.sublime-keymap
Created January 11, 2015 12:57
My Sublime Text key mappings
[
{
"keys": ["alt+w"],
"command": "toggle_setting",
"args":
{
"setting": "word_wrap"
}
},
{
class Entity
constructor: (params) ->
@user_id = params.user_id
@logged_in = true
@user_data = {}
class User extends Entity
class Admin extends Entity
do_something = ->