Skip to content

Instantly share code, notes, and snippets.

family = 'wikipedia'
mylang = 'en'
usernames['wikipedia']['en'] = 'JVbot-test'
#!/usr/bin/env python
"""
Print out a report of Wikipedia articles you've visited using your Google Chrome history database.
The output is in Markdown, and you'll need to shutdown Chrome before you run this or else the
database will be locked.
"""
import os
import re
@jayvdb
jayvdb / merge.md
Created August 8, 2014 19:13 — forked from pablitoc/merge.md

If someone forks a gist and you'd like to merge their changes. Do this:

  1. clone your repo, I use the name of the gist

     git clone git://gist.github.com/1163142.git gist-1163142
    
  2. add a remote for the forked gist, I'm using the name of my fellow developer

     git remote add aaron git://gist.github.com/1164196.git
    
# -*- coding: utf-8 -*-
"""
Get a github user's fork of a gist.
Given a starting gist id, traverse the forks to find
a gist for the github username provided in the first
parameter of the command line.
"""
import json
import urllib2
@jayvdb
jayvdb / NOTES.txt
Created April 10, 2016 08:12
Other project euler like sites
* http://rosalind.info/
@jayvdb
jayvdb / add_answer.py
Last active June 16, 2016 08:30
Pocket Euler hacks
import sys
def load_answers(answer_filename):
answers = {}
lines = open(answer_filename).readlines()
for line in lines:
problem, answer = line.strip().split(': ')
answers[int(problem)] = answer
return answers
# git checkout README.md
remark ./README.md > ./README.md.new
sed -i 's/&lt;/</g' README.md.new
sed -i 's:\\\\:\\:g' README.md.new
sed -i 's/&#x3A;/:/g' README.md.new
#sed -i 's/\\\*\\\*/**/;s/^\(\**[^*]*\)\\\*\([^*]*\)$/\1*\2/g' README.md.new
#sed -i 's/\\\*\\\*/**/;s/^\(\*{0,1}[^*]*\)\\\*\([^*]*\)$/\1*\2/g' README.md.new # may need to guard against a star before the current star
sed -Ei 's/\\\*\\\*/**/;s/^(\*{0,1}[^*]*)\\\*([^*]*)$/\1*\2/g' README.md.new
sed -i 's/\\|/|/g' README.md.new
sed -i 's/\\_/_/g' README.md.new
@jayvdb
jayvdb / check_dubious_concat.py
Created July 25, 2016 16:12 — forked from lordmauve/check_dubious_concat.py
Linter for implicit string literal concatentation in list-like context
def check_dubious_concat(src):
"""Check for suspicious string literal concatenation.
We will warn about instances of string literal concatenation in list-like
contexts - that is, where concatenated string literals are adjacent to
commas or inside square brackets.
Such a heuristic will catch instances like this::
foo = [
@jayvdb
jayvdb / osm-id-coastline-ways.geojson
Last active August 30, 2016 13:38 — forked from anonymous/overpass.geojson
OSM Indonesia coastline
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.