Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>Algorithms Part 1 - Book 2 - Closest Point Pairs</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style type="text/css">
/*!
# create a new user
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev libpq-dev
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@motleytech
motleytech / create_linux_user.sh
Created April 8, 2016 03:02
Create user on linux
sudo groupadd -f --system webapps
adduser webuser
sudo usermod -a -G webapps `whoami`
sudo usermod -a -G webapps webuser
@motleytech
motleytech / useful_aliases.md
Created April 8, 2016 17:56
Useful bash aliases

alias clean-dammit='rm -rf node_modules bower_components tmp dist && npm cache clean && npm set progress=false && npm install && npm set progress=true && bower install'

@motleytech
motleytech / pre-commit (remove extension).py
Last active April 14, 2016 03:22
Git pre-commit hook to verify tests updated for python files
#!/usr/bin/env python2.7
"""
Git pre-commit hook to check if tests have been added
or modified for staged python files.
__author__ = "Motleytech http://github.com/motleytech"
"""
# pylint: disable=C0103
import subprocess
@motleytech
motleytech / .pylintrc
Created April 14, 2016 04:40
pylintrc
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
@motleytech
motleytech / pystarter.cson
Created April 15, 2016 01:59
python starter snippet for atom
'.source.python':
'scaffolding':
'prefix': 'sca'
'body': '''
"""
module for doing module stuff
"""
__author__ = 'Motleytech <https://github.com/motleytech>'
def main():
WS_EX_TOOLWINDOW := 0x00000080
+MButton::WinSet, ExStyle, ^%WS_EX_TOOLWINDOW%, A
^MButton::WinSet, AlwaysOnTop, toggle, A
@motleytech
motleytech / rename.py
Created May 22, 2016 05:48
rename files python drag drop target
import os
import sys
from pprint import pprint as pp
inpFiles = sys.argv[1:]
replacements = [
('.', ' '),
]