Skip to content

Instantly share code, notes, and snippets.

@paatsinsuwan
paatsinsuwan / array_implode.js
Created July 31, 2011 23:30
easier method for join the array
Array.prototype.implode = function(character){
result = "";
for(k = 0; k < this.length; k++){
result += this[k]+character;
}
return result;
}
@paatsinsuwan
paatsinsuwan / linkify_tweet.js
Created July 31, 2011 23:35
linkify all @screen_name and #hashtag
/*
* credited to Stephen Granade
* http://granades.com/
*/
String.prototype.linkify_tweet = function() {
var tweet = this.replace(/(^|\s)@(\w+)/g, '$1@<a href="http://www.twitter.com/$2">$2</a>');
return tweet.replace(/(^|\s)#(\w+)/g, '$1#<a href="http://search.twitter.com/search?q=%23$2">$2</a>');
};
@paatsinsuwan
paatsinsuwan / sentence.case.js
Created August 16, 2011 19:24
Javascript sentence case
String.prototype.sentenceCase = function(){
return this.substring(0,1).toUpperCase() + this.substring(1);
}

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@paatsinsuwan
paatsinsuwan / .ghprrc
Last active April 11, 2024 16:03
Add Github preview checkout for reviewing
# Adding Github PR preview function
# required: gh - install `brew install gh`
# required: fzf - install `brew install fzf`
# put this file in ~ (home directory) where all the dotfiles are
# add `source ~/.ghprrc` to your shell rc file (.bashrc, .zshrc)
# open a new Terminal window to activate this script
# to run function
# from a new Terminal window