Skip to content

Instantly share code, notes, and snippets.

Eric Newport kethinov

View GitHub Profile
View white terminals bash profile.sh
PWDMAXLENGTH=30
PROMPTTRUNCSYM="..."
# Change the window title of X terminals
case $TERM in
xterm*|rxvt|Eterm|eterm)
PROMPT_COMMAND_TITLE="\033]0;USER@HOSTNAME:CURRDIR\007"
;;
screen)
PROMPT_COMMAND_TITLE='\033_USER@HOSTNAME:CURRDIR\033\\'
View black terminals bash profile.sh
PWDMAXLENGTH=30
PROMPTTRUNCSYM="..."
# Change the window title of X terminals
case $TERM in
xterm*|rxvt|Eterm|eterm)
PROMPT_COMMAND_TITLE="\033]0;USER@HOSTNAME:CURRDIR\007"
;;
screen)
PROMPT_COMMAND_TITLE='\033_USER@HOSTNAME:CURRDIR\033\\'
@kethinov
kethinov / walksync.js
Created Sep 22, 2013
List all files in a directory in Node.js recursively in a synchronous fashion
View walksync.js
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
View html-domparser.js
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
View html-domparser.js
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
You can’t perform that action at this time.