- Install Python on your machine
- On Mac -
$ python --version
- On Window - https://www.python.org/downloads/windows/
- On Mac -
- Install the Python package manager
- pip should be installed with most versions of python
- Most likely you should upgrade your pip with
$ pip install -U pip
for mac orpython -m pip install -U pip
for windows - Check to see if it is installed with
$ pip --version
$ sudo easy_install pip
or download get-pip.py and$ python get-pip.py
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 sys | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option('-p', '--prefix', type='str', dest='prefix', help='Allows you to prefix the output name') | |
(options, args) = parser.parse_args() | |
def convert_field(x, prefix=None): | |
"""" |
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
// survival Survival (0 = No; 1 = Yes) | |
// pclass Passenger Class (1 = 1st; 2 = 2nd; 3 = 3rd) | |
// name Name | |
// sex Sex | |
// age Age | |
// sibsp Number of Siblings/Spouses Aboard | |
// parch Number of Parents/Children Aboard | |
// ticket Ticket Number | |
// fare Passenger Fare | |
// cabin Cabin |
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
from __future__ import division | |
def calculate_mean(numbers): | |
total = sum(numbers) | |
count = len(numbers) | |
return total / count | |
def calculate_median(numbers): |
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
USE sakila; | |
-- Film | |
/* | |
This step represents moving the data from production tables into a new database. | |
This stage allows data manipulation without locking tables or impacting the production system. | |
*/ |
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
USE sakila; | |
-- Film | |
DROP TABLE IF EXISTS src_film; | |
CREATE TABLE src_film LIKE film; | |
INSERT src_film SELECT * FROM film; |
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
camel_pat = re.compile(r'([A-Z])') | |
under_pat = re.compile(r'_([a-z])') | |
def camel_to_underscore(name): | |
return camel_pat.sub(lambda x: '_' + x.group(1).lower(), name) | |
def underscore_to_camel(name): | |
return under_pat.sub(lambda x: x.group(1).upper(), name) |
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
camel_pat = re.compile(r'([A-Z])') | |
under_pat = re.compile(r'_([a-z])') | |
def camel_to_underscore(name): | |
return camel_pat.sub(lambda x: '_' + x.group(1).lower(), name) | |
def underscore_to_camel(name): | |
return under_pat.sub(lambda x: x.group(1).upper(), name) |
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/env bash | |
set -e | |
gain=${3-"2"} | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: $0 input.aifc output.aifc [gain=2]" | |
exit 1 | |
else |
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
source 'https://rubygems.org' | |
ruby "2.2.2" | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.2.1' | |
# Views | |
gem 'bootstrap-sass', '~> 3.3.4' | |
gem 'sass-rails' |