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
// http://www.sensefulsolutions.com/2012/01/viewing-chrome-cache-easy-way.html | |
(function() { | |
var preTags = document.getElementsByTagName('pre'); | |
var preWithHeaderInfo = preTags[0]; | |
var preWithContent = preTags[2]; | |
var lines = preWithContent.textContent.split('\n'); | |
// get data about the formatting (changes between different versions of chrome) | |
var rgx = /^(0{8}:\s+)([0-9a-f]{2}\s+)[0-9a-f]{2}/m; |
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
forever start -e ~/.npm-local/err.log --plain --workingDir ~/.npm-local /usr/local/bin/local-npm |
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
PS1='\[\e]1;My Desk\a\e]2;${PWD}\a\]\ | |
[\u@ME \w]\n \#\$ ' | |
PS1='\[\e]2;${PWD}\a\ | |
\e[0;34m\]\ | |
[\u@MyMacBook \w]\n \#\$ \ | |
\[\e[m\]' | |
#Default, but Working Dir in blue color | |
PS1='\h:\[\e[0;34m\]\W \[\e[m\]\u\$ ' |
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
define(function(require){ | |
//var React = require('react'); | |
var jQuery = require('jquery'); | |
//var TemplatesPanel = require('modules/pathboard/common/views/templatesPanel'); | |
//var Templates = require('modules/pathboard/common/models/templates'); | |
//var templates = new Templates(); | |
//var Loading = require('ui/react/loading'); | |
//var Panel = require('ui/react/modals/panel'); |
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
cd `brew --prefix` | |
rm -rf Cellar | |
brew prune | |
rm `git ls-files` | |
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions | |
rm -rf .git | |
rm -rf ~/Library/Caches/Homebrew |
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
sudo easy_install pip | |
pip install --user neovim |
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
function* objectEntries(obj) { | |
let propKeys = Reflect.ownKeys(obj); | |
for (let propKey of propKeys) { | |
yield [propKey, obj[propKey]]; | |
} | |
} | |
let jane = { first: 'Jane', last: 'Doe' }; | |
for (let [key, value] of objectEntries(jane)) { |
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
var bsearch = function(arr, k){ | |
var l = 0, r = arr.length-1, m; | |
console.log(arr); | |
while(l<r){ | |
m = (l+r)/2^0; | |
console.log(m); | |
if(k>arr[m]) |
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
public int nextInt(int n) { | |
if (n <= 0) | |
throw new IllegalArgumentException("n must be positive"); | |
if ((n & -n) == n) // i.e., n is a power of 2 | |
return (int)((n * (long)next(31)) >> 31); | |
int bits, val; | |
do { | |
bits = next(31); |
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
/** | |
* | |
* Print From 45 to 4578 Without Repeating Digits | |
* | |
* Write a method that prints all the numbers from 45 to 4578 to the console, | |
* with the constraint that you cannot print any number with repeating digits. | |
* This means the following numbers would be skipped: 11, 22, ...., 122, 110,.... | |
* | |
* Created by vbauer on 19/04/14. | |
*/ |