Skip to content

Instantly share code, notes, and snippets.

@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>
View gist:260780defd28739c50c05e1c1f83df53
def create_payload(url, start_year, stop_year, timelapse_level):
collapse_options = {'yearly': 'timestamp:4', 'monthly': 'timestamp:6'}
collapse = collapse_options[timelapse_level]
payload = {
'url': url,
'output': 'json',
'fl': 'timestamp,original',
'from': start_year,
View script.sh
#!/bin/bash
for f in *.png
do
echo "Processing $f file"
convert $f -crop 1024x77+0+0 +repage first.png
convert $f -crop 1024x50+0+440 +repage second.png
convert $f -crop 1024x902+0+788 +repage third.png
montage first.png second.png third.png -tile x3 -geometry +0+0 final-$f
done
@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 Download and merge HTTP Live Streaming .ts files
<?php
/*
Made by Kudusch (blog.kudusch.de, kudusch.de, @Kudusch)
---------
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
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
#