Skip to content

Instantly share code, notes, and snippets.

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,
#!/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 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
@nitinthewiz
nitinthewiz / st-anti-string-search.txt
Created December 15, 2015 00:58
Finding text without a particular string in Sublime text
Sublime Text uses PCRE which is Perl Regex.
The following RegEx -
(<\?)(?:(?!php))
will match
<? blah ?>
<?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>
javascript:function iptxt(){var d=document;try{if(!d.body)throw(0);window.location='http://www.instapaper.com/text?u='+encodeURIComponent(d.location.href);}catch(e){alert('Please wait until the page has loaded.');}}iptxt();void(0)