Skip to content

Instantly share code, notes, and snippets.

View rwoody's full-sized avatar

Ryan rwoody

  • Texas
View GitHub Profile
@rwoody
rwoody / Preferences.sublime-settings
Created October 2, 2012 18:13
Sublime Text 2 Preferences
{
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme",
"draw_centered": false,
"fade_fold_buttons": false,
"font_size": 15.0,
"ignored_packages":
[""],
"scroll_speed": 1.5,
"tab_size": 2,
"translate_tabs_to_spaces": true,
# ~/.osx — http://mths.be/osx
# root check
if [[ $EUID -ne 0 ]]; then
echo "################################";
echo "## YOU ARE NOT RUNNING AS ROOT #";
echo "################################";
echo "#";
echo "# USAGE: sudo $0";
exit;
@rwoody
rwoody / Preferences.sublime-settings
Created September 6, 2013 06:33
Sublime 3 settings
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": true,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",

Enter this in the to have OSX save screenshots to ~/Dropbox/Screenshots/:

defaults write com.apple.screencapture location ~/Dropbox/Screenshots/

or change back to default behavior like so:

defaults write com.apple.screencapture location ~/Desktop/
@rwoody
rwoody / youtubeID.js
Last active August 29, 2015 13:56 — forked from takien/youtubeID.js
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function getYouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);

Keybase proof

I hereby claim:

  • I am rwoody on github.
  • I am rwoody (https://keybase.io/rwoody) on keybase.
  • I have a public key whose fingerprint is 0D8F E5D5 B4CB 90C9 62A7 0FC3 B705 107C 51B9 F3AD

To claim this, I am signing this object:

@rwoody
rwoody / UserSchema.js
Created April 14, 2017 15:04
Mongoose User Password middleware
import encryptPassword, {comparePassword} from './encryptPassword'
/**
* Password hash middleware.
*/
UserSchema.pre('save', function (next) {
const user = this;
if (!user.isModified('password')) { return next(); }
encryptPassword(user.password).then(hash => {

Keybase proof

I hereby claim:

  • I am rwoody on github.
  • I am rwoody (https://keybase.io/rwoody) on keybase.
  • I have a public key whose fingerprint is 7ABB 2A9B E322 25B1 CA6F 554C 859F 8465 77D9 695F

To claim this, I am signing this object:

@rwoody
rwoody / .editorconfig
Created October 25, 2017 14:34
Editorconfig - PHP
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true
[*.php]