start new:
tmux
start new with session name:
tmux new -s myname
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'digest/md5' | |
require 'fastercsv' | |
require 'json' | |
require 'curb' | |
require 'pp' | |
data = [] |
from django.contrib.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |
1. Goto http://dev.mysql.com/downloads/mysql/ | |
2. Select Platform: "Mac OS X" | |
3. Download mysql-5.5.11-osx10.6-x86.tar.gz | |
(Mac OS X ver. 10.6 (x86, 32-bit), Compressed TAR Archive) | |
4. Unzip it | |
5. Copy include folder into /Applications/MAMP/Library | |
6. Copy lib/* files into /Applications/MAMP/Library/lib | |
---- | |
1. Goto http://sourceforge.net/projects/mysql-python/ |
# Super messy and hacked together from what I saw at http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt, but then with time since last commit smooshed in | |
export PS1="\[\033[38m\]\u\[\033[01;34m\]:\W \[\033[31m\]\`ruby -e \"git_status = (%x{git status 2> /dev/null}); last_commit = (%x{git log --pretty=format:'%at' -1 2> /dev/null}).gsub(/^\* (.+)$/, '(\1) '); seconds = Time.now.to_f - last_commit.to_f; minutes = seconds.to_f / 60; ((seconds > 60*60*2) ? (time_since_commit = ('+2h')) : (time_since_commit = minutes.to_i.to_s + 'm') if (git_status != ''));print (%x{git branch 2> /dev/null}.split(%r{\n}).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(' + time_since_commit.to_s + '|\1) ')\"\`\[\033[37m\]$\[\033[00m\] " |
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
#!/usr/bin/env python | |
from numpy import asmatrix, asarray, ones, zeros, mean, sum, arange, prod, dot, loadtxt | |
from numpy.random import random, randint | |
import pickle | |
MISSING_VALUE = -1 # a constant I will use to denote missing integer values | |
def impute_hidden_node(E, I, theta, sample_hidden): |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src=https://raw.github.com/gist/2941416/24172d26b3c802f5be54b3411863822cad6b8538/tooltip.custom.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/gist/2941416/39fbe358eb3256e62401e2403735907fbe3f7a75/popover.js"></script> | |
</head> | |
<body> | |
<div id="chart"></div> |
<!doctype html> | |
<head> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
#main { | |
left: 25%; | |
position: absolute; | |
} |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |