Skip to content

Instantly share code, notes, and snippets.

@nitinthewiz
nitinthewiz / Dockerfile
Created January 23, 2020 18:20 — forked from aurelijusb/Dockerfile
Code snippets for Minsk PHP Night presentation: Headless browsers and friends
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y xvfb firefox python-pip xdotool x11vnc
RUN apt-get install -y wget
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-linux64.tar.gz
RUN tar zxvf geckodriver-v0.16.1-linux64.tar.gz && mv geckodriver /usr/bin/geckodriver
ENV DISPLAY=:1.0
(work-python 2.7)$ pip freeze
Flask==0.9
Jinja2==2.6
PIL==1.1.7
Werkzeug==0.8.3
distribute==0.6.26
gevent==1.0b3
gevent-zeromq==0.2.5
greenlet==0.4.0
ipython==0.12.1
@nitinthewiz
nitinthewiz / app.py
Created October 23, 2016 19:25 — forked from notbanker/app.py
Bayesian calculation for twin Down Syndrome probabilities (Flask app)
from flask import Flask, request, url_for
from scipy.optimize import bisect
import math
import numpy as np
app = Flask(__name__)
app.secret_key = 'Whatever'
@app.route('/')
def index():
@nitinthewiz
nitinthewiz / mplonflask.py
Created October 23, 2016 19:20 — forked from tkf/mplonflask.py
matplotlib on Flask
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot
import numpy
from flask import Flask, send_file
from cStringIO import StringIO
app = Flask(__name__)
@nitinthewiz
nitinthewiz / private.xml
Created August 18, 2016 20:26 — forked from DanSkeel/private.xml
Settings for Karabiner to enable Shift+Enter shortcut for newline in Messages app
<?xml version="1.0"?>
<!-- Documentation: https://pqrs.org/osx/karabiner/xml.html.en -->
<root>
<appdef>
<appname>Messages</appname>
<equal>com.apple.iChat</equal>
</appdef>
<item>
<name>Enable Shift+enter newline shortcut in Messages app</name>
<identifier>private.Messages.NewLine</identifier>
@nitinthewiz
nitinthewiz / Main.Sublime-menu file
Created May 10, 2016 17:28 — forked from 5eleven/Main.Sublime-menu file
Sublime Text 2 Layout: Grid: 6
// "Cols" and "Rows" specify the coordinates in x and y.
// Cells create cells by indexing the rows and cols array in the order [startx, starty, endx, endy].
// Edit your Main.Sublime-menu file
// Mac: /Users/yourMacName/Library/Application Support/Sublime Text 2/Packages/Default
// PC: C:\Users\yourPCName\AppData\Roaming\Sublime Text 2\Packages\Default
// Example Below:
{
"caption": "Grid: 6",
"command": "set_layout",

Readernaut API

I'm going to be deprecating the current Readernaut API in favor of a newer more built-out version. People using the current version have two weeks to switch over to the new API. Currently you can find your API_KEY by viewing source on any page and searching for "api_key" in the output (this will get better later). Here are some example endpoints:

Notes

  • Old: /services/api/USERNAME/notes/
  • New: /api/v1/notes/note/?username=YOUR_USERNAME&api_key=YOUR_API_KEY&user__username=USERNAME

Books

@nitinthewiz
nitinthewiz / hack.sh
Created January 14, 2016 00:22 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nitinthewiz
nitinthewiz / hack.sh
Created January 14, 2016 00:22 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nitinthewiz
nitinthewiz / ReporterSaveFileDescription.md
Created January 6, 2016 09:29 — forked from dbreunig/ReporterSaveFileDescription.md
A description of the data written to the Reporter App Dropbox save folder.

#Reporter Save File Schema

##The Reporter Export File

Reporter saves to your Dropbox account with plaintext JSON files, one for each day. When a Report is entered in the app a file is created for that day if it does not exist. Otherwise, the report is appended to the existing file. The save folder is located in 'Dropbox/Apps/Reporter-App/'.

Reporter save files are named according to the following convention:

YYYY-MM-DD-reporter-export.json