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
sudo stdbuf -oL -eL /usr/bin/tcpdump -i lo -A -s 10240 "tcp port 10000 " | egrep -a --line-buffered ".+(GET |HTTP\/|POST )|^[A-Za-z0-9-]+: " | perl -nle 'BEGIN{$|=1} { s/.*?(GET |HTTP\/[0-9.]* |POST )/\n$1/g; print }' | |
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
pandoc --from=epub+native_divs+native_spans --to=rtf source.epub | unrtf | pandoc --from=html-native_divs-native_spans --to=markdown_strict > acceptable.md |
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
# variables hold values the user enters | |
# we also use them to guide program flow | |
# by the way - these are comments. They start with # - after that the rest of the line is ignored | |
number = 1 # define a variable | |
string = "Some text" # a string is a variable containing text | |
list = [1,2,3,4] # we can also define lists of things | |
number = 2 # changing the value of a variable | |
number = number + 1 # we can use the variable itself, any expression, to set the new value. The value of number is now 3 |
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
Install the Dokku droplet - smallest possible digitalocean vm works fine | |
Make sure you add your ssh key so you can git over ssh and ssh into the image later | |
* On the image be sure to NOT set up IPv6 | |
Boot the image - note the ip | |
Add a star alias on some domain you control and point it at that ip address - this lets you dokku up a lot of projects at somedomain.yourdomain.com | |
Go to http://[your IP address] to finalize dokku setup - set up virtual domains to make use of the star alias you just made | |
* You need to add your ssh public key here as well | |
* You CANNOT just add your key to authorised_keys - you need to use sshcommand - this enables the whole 'push to deploy' workflow | |
Follow the Flask-y steps here https://www.linode.com/docs/applications/containers/deploy-a-flask-application-with-dokku/ |
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 matplotlib.pyplot as plt | |
import seaborn as sns | |
import numpy as np | |
from sklearn.cross_validation import train_test_split | |
from sklearn.linear_model import LogisticRegressionCV | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Activation | |
from keras.utils import np_utils |
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 numpy as np | |
import pandas as pd | |
import lda | |
import lda.datasets | |
from sklearn.feature_extraction.text import CountVectorizer | |
def load_questions(): | |
sheet = pd.read_excel('android_watch.xlsx') | |
Qs = sheet['Question'] |
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 python | |
# | |
# Mixpanel, Inc. -- http://mixpanel.com/ | |
# | |
# Python API client library to consume mixpanel.com analytics data. | |
# | |
# Copyright 2010-2013 Mixpanel, Inc | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. |
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
class IntrospectBinding | |
attr_accessor :binding, :evals | |
def initialize(binding) | |
@binding = binding | |
@evals = [] | |
end | |
def eval(string, filename = '', lineno = 0) |
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/ruby | |
require 'erb' | |
require 'json' | |
require 'yaml' | |
require 'fileutils' | |
@from = ARGV.shift || 'files' | |
@to = ARGV.shift || 'dist' | |
# definitions |
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 argparse | |
import pandas as pd | |
import mysql.connector | |
from sqlalchemy import create_engine | |
from string import Template | |
import os | |
import argparse | |
parser = argparse.ArgumentParser() |
NewerOlder