Skip to content

Instantly share code, notes, and snippets.

# Limit of files
ulimit -S -n 1024
alias l="ls -alt"
alias locate='if [ $((`date +%s`-`eval $(stat -s /var/db/locate.database); echo $st_mtime`)) -gt 3600 ]; then echo "locate: db is too old!">/dev/stderr; sudo /usr/libexec/locate.updatedb; fi; locate -i'
#PS1="[\u:\w]:\\$ "
[[ -s "/Users/mike/.rvm/scripts/rvm" ]] && source "/Users/mike/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Hello World 2

@michealbenedict
michealbenedict / index.json
Created August 14, 2012 06:45
Blog Index
[
"3346986",
"3267371"
]
@michealbenedict
michealbenedict / LICENSE.txt
Created August 15, 2012 06:23 — forked from sdepold/LICENSE.txt
140byt.es -- addObserverMethods
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sascha Depold http://depold.com
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
package all;
public class FDList<T> {
public class Element{
T val1;
Element next;
Element prev;
public Element(T a, Element b, Element c){
val1=a;
@michealbenedict
michealbenedict / .bash_profile
Created September 12, 2012 18:47
Bash Profile
# Limit of files
ulimit -S -n 1024
alias l="ls -alt"
alias locate='if [ $((`date +%s`-`eval $(stat -s /var/db/locate.database); echo $st_mtime`)) -gt 3600 ]; then echo "locate: db is too old!">/dev/stderr; sudo /usr/libexec/locate.updatedb; fi; locate -i'
#PS1="[\u:\w]:\\$ "
alias gc="git commit -m $1"
alias gca="git add -A; git commit -m $1"
@michealbenedict
michealbenedict / logistic-regression.js
Created October 20, 2012 00:05
Logistic Regression
var LogisticRegression = function() {
this.N = 0; // Number of Samples
this.D = 0; // Number of Dimensions|Features
this.K = 0; // Number of Classes
this.classes = []; // Classes to classify
this.weights = []; // Weights
this.input = []; // [{0 1 0 1 0 ... 512} , {}]
this.output = []; // [{zero:0,one:1.0...}, ...]
}
static long foo = 0;
public static Lock lock = newLock();
private static void increment() {
for(long l=0;l<1000000000L;l++) {
lock.lock();
try {
foo++;
} finally {
lock.unlock();
@michealbenedict
michealbenedict / C.js
Last active December 9, 2015 23:29
Sugar code to help write simpler callback functions.
/**
* `C` constructor
*
* Proposed Simpler API for callback functions within a function
*
* // Old style
* someFunction(1, function success () {
* console.log('success callback')
* }, function fail () {
* console.log('fail callback')
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#