Skip to content

Instantly share code, notes, and snippets.

@nitinthewiz
nitinthewiz / Dockerfile
Created Jan 23, 2020 — forked from aurelijusb/Dockerfile
Code snippets for Minsk PHP Night presentation: Headless browsers and friends
View Dockerfile
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
View gist:2ae690e1b46bf3f04d8a9a21750657a5
(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 Oct 23, 2016 — forked from notbanker/app.py
Bayesian calculation for twin Down Syndrome probabilities (Flask app)
View app.py
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 Oct 23, 2016 — forked from tkf/mplonflask.py
matplotlib on Flask
View mplonflask.py
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 Aug 18, 2016 — forked from DanSkeel/private.xml
Settings for Karabiner to enable Shift+Enter shortcut for newline in Messages app
View private.xml
<?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 — forked from 5eleven/Main.Sublime-menu file
Sublime Text 2 Layout: Grid: 6
View Main.Sublime-menu file
// "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",
View gist:822b4af64130b397121c

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 Jan 14, 2016 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/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 Jan 14, 2016 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/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 Jan 6, 2016 — forked from dbreunig/ReporterSaveFileDescription.md
A description of the data written to the Reporter App Dropbox save folder.
View ReporterSaveFileDescription.md

#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