Skip to content

Instantly share code, notes, and snippets.

// 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;
forever start -e ~/.npm-local/err.log --plain --workingDir ~/.npm-local /usr/local/bin/local-npm
@vbauerster
vbauerster / change_prompt.txt
Created May 11, 2014 08:35
terminal prompt modifications
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\$ '
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');
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
sudo easy_install pip
pip install --user neovim
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)) {
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])
@vbauerster
vbauerster / Random.nextInt
Created May 5, 2014 19:58
java.util.Random.nextInt(n)
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);
/**
*
* 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.
*/