This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This was used to update all column numbers in ESLint tests when we | |
# changed to 1-based columns from 0-based | |
$ perl -pi.bak -e "s/(column: *)([0-9]+)/\$1.(\$2+1)/e;" tests/lib/rules/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//snip from wordpress/wp-admin/includes/export.php | |
/*$where = ''; | |
if ( $author and $author != 'all' ) { | |
$author_id = (int) $author; | |
$where = $wpdb->prepare(" WHERE post_author = %d ", $author_id); | |
}*/ | |
$query = " | |
SELECT ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Section 10.6 Note 1 in ECMA-262, 5th Edition says: | |
* | |
* For non-strict mode functions the array index (defined in 15.4) named data | |
* properties of an arguments object whose numeric name values are less than | |
* the number of formal parameters of the corresponding function object initially | |
* share their values with the corresponding argument bindings in the function's | |
* execution context. This means that changing the property changes the | |
* corresponding value of the argument binding and vice-versa. | |
* | |
* Thus, the following function should work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I was trying to figure out how to get a list of changes made remotely on Git | |
# before applying. Here's what I came up with. | |
# First, get the latest data from the origin | |
git fetch origin | |
# Then, get the changes and output to a file | |
git log HEAD..origin/master > changes.txt | |
# Merge changes in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Download your Google Apps-hosted email | |
wget --secure-protocol=TLSv1 --no-check-certificate --user=you@yourdomain.com --password=your_password https://mail.google.com/a/yourdomain.com/feed/atom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicholas@nicholas-VirtualBox:~/share/yuitest/javascript/build/yuitest/npm$ cat npm-debug.log | |
info it worked if it ends with ok | |
verbose cli [ 'node', '/usr/local/bin/npm', 'link', 'yuitest' ] | |
info using npm@1.0.6 | |
info using node@v0.4.0 | |
verbose config file /home/nicholas/.npmrc | |
verbose config file /usr/local/etc/npmrc | |
info unbuild /home/nicholas/share/yuitest/javascript/build/yuitest/npm/node_modules/yuitest | |
verbose link symlinking /usr/local/lib/node_modules/yuitest to /home/nicholas/share/yuitest/javascript/build/yuitest/npm/node_modules/yuitest | |
verbose mkdir done: /home/nicholas/share/yuitest/javascript/build/yuitest/npm/node_modules 755 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Quick and Dirty sprintf | |
* Copyright 2011 Nicholas C. Zakas. All rights reserved. | |
* BSD licensed | |
*/ | |
/* | |
* This function does not attempt to implement all of sprintf, just %s, | |
* which is the only one that I ever use. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1="\w\$(parse_git_branch) $ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Use the following in the "resultFilters" option when creating a YUI 3 Autocomplete | |
* widget. This will return matches when *any* of the words in the query string match. | |
* This is opposed to the default "wordMatch", which matches *all* words in the | |
* query string. | |
*/ | |
function matchAnyWord(query, results) { | |
var WordBreak = Y.Text.WorkBreak, |