- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
This file contains hidden or 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
| #!/usr/bin/bash | |
| #tr -d '\15' < f1.bash > f2.bash - (windows/cygwin complications - porting to UNIX file type to add newline chars) | |
| [[ $# -ne 1 ]] && { | |
| echo "Error: requires a folder name"; | |
| exit 1; | |
| } | |
| mkdir -p $1/public/javascripts $1/public/stylesheets $1/views | |
| cd $1 |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+X | delete line |
| Ctrl+↩ | insert line after |
| Ctrl+⇧+↩ | insert line before |
| Ctrl+⇧+↑ | move line (or selection) up |
This file contains hidden or 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
| git ls-files | grep '\.swp$' | xargs git rm |
This file contains hidden or 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
| import sqlite3 | |
| class User(): | |
| def __init__(self, id, age, occupation, male): | |
| self.id = id | |
| self.male = male | |
| self.age = age | |
| self.occupation = occupation | |
| self.movie_ratings = {} |
This file contains hidden or 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
| import sqlite3 | |
| class User(): | |
| def __init__(self, id, age, occupation, male): | |
| self.id = id | |
| self.male = male | |
| self.age = age | |
| self.occupation = occupation | |
| self.movie_ratings = {} | |
| self.set_movie_ratings() |
This file contains hidden or 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 [J, grad] = costFunctionReg(theta, X, y, lambda) | |
| m = length(y); % number of training examples | |
| J = 0; | |
| grad = zeros(size(theta)); | |
| [J, grad] = costFunction(theta, X,y); | |
| reg = ( (sum(theta.^2) - theta(1,1)^2) * (lambda/(2*m)) ) | |
| J = J + reg; | |
| for iter = 1:size(grad), | |
| if (iter) > 1, |
This file contains hidden or 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
| There are 4 parts to successfully running django apps on nginx and gunicorn. | |
| 1. Set up gunicorn | |
| 2. Set up supervisor | |
| 3. Set up nginx. | |
| 4. Making admin staticfiles work | |
| Step 1 | |
| ==== | |
| Assuming you have gunicorn installed, just run your app using the command - gunicorn_django <ip_address:port> |
This file contains hidden or 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
| # birthday problem - http://en.wikipedia.org/wiki/Birthday_problem | |
| def get_prob(n): | |
| p, i = 1.0, 0 | |
| while (i < n): | |
| p = p * (365 - i) / 365 | |
| i += 1 | |
| return (1 - p) | |
| def func_get_prob(n): |
This file contains hidden or 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
| import requests | |
| def check(r): | |
| base_url = "http://www.letsrevolutionizetesting.com/challenge.json?id=" | |
| print "Hitting: %s" % r.url | |
| if 'follow' in r.json(): | |
| url_to_follow = r.json().get('follow') | |
| new_url = base_url + url_to_follow.split("=")[-1] | |
| check(requests.get(new_url)) | |
| else: |
OlderNewer