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
# Add this to bashrc. | |
__git_ps1 () | |
{ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)"; | |
if [ -n "$b" ]; then | |
printf " (%s)" "${b##refs/heads/}"; | |
fi | |
} | |
PS1="\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u\[\033[01;34m\] \w\[\033[35m\]\$(__git_ps1) \[\033[01;34m\]\$\[\033[00m\] " |
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
# Installing OpenCV python libs on mac to work with virtualenv | |
# OpenCV 2.4.3 | |
# Python 2.7.3 installed with brew | |
# assuming you have virtualenv, pip, and python installed via brew | |
# assuming $WORKON_HOME is set to something like ~/.virtualenvs | |
# using homebrew - make sure we're current | |
brew update |
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
#!/usr/bin/env bash | |
## create an ubuntu 14.04 hvm instance, then from your home directory: | |
# 1. download this script | |
# wget https://gist.githubusercontent.com/waylonflinn/506f563573600d944923/raw/install-python-data-science.sh | |
# 2. make it executable | |
# chmod a+x install-python-data-science.sh |
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
phploc 3.0.0 by Sebastian Bergmann. | |
Directories 3 | |
Files 51 | |
Size | |
Lines of Code (LOC) 5756 | |
Comment Lines of Code (CLOC) 2422 (42.08%) | |
Non-Comment Lines of Code (NCLOC) 3334 (57.92%) | |
Logical Lines of Code (LLOC) 790 (13.72%) |
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
def secure_uuid(): | |
"""Create a non-conforming 128-bit random version 4 UUID. | |
Random UUID is a RFC 4122 compliant UUID version 4 128-bit number. By default 6 fixed bits, 4 bits for version and 2 bits reserved for other purposes, are fixed. This function behaves like Python's ` uuid4()`` but also randomizes the remaining six bits, generating up to 128 bit randomness. | |
This function also sources all bytes from `os.urandom()` to guarantee the randomness and security and does not rely operating system libraries. | |
Using ``secure_uuid()`` poses a risk that generated UUIDs are not accepted when communicating with third party system. However, they are observed to be good for URLs and to be stored in PostgreSQL. | |
More information |
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
#chat-box.ubuntu.hidden-xs | |
.closed | |
.pull-right | |
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()' | |
.m-l-small | |
= link_to_function 'Chat with us', 'chat.show()' | |
.opened{style: 'display: none'} | |
.header | |
.pull-right | |
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none' |
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
from flask import Blueprint | |
from flask import url_for | |
from flask.ext.login import current_user | |
from flask.ext.login import login_user | |
from flask.ext.login import logout_user | |
from flask.ext.login import login_required | |
from forms import LoginForm | |
from forms import ForgotPasswordForm | |
from forms import ResetPasswordForm |
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
#!/bin/sh | |
git filter-branch --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ] |
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
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
OlderNewer