Skip to content

Instantly share code, notes, and snippets.

View themiurgo's full-sized avatar
🎯
Focusing

Antonio Lima themiurgo

🎯
Focusing
View GitHub Profile
@dartar
dartar / scholar.py
Created May 19, 2012 16:49
Modified version of scholar.py (a python Google Scholar parser by Christian Kreibich) exposing direct PDF download URL when available
#! /usr/bin/env python
"""
This module provides classes for querying Google Scholar and parsing
returned results. It currently *only* processes the first results
page. It is not a recursive crawler.
"""
# Version: 1.3 -- $Date: 2012-02-01 16:51:16 -0800 (Wed, 01 Feb 2012) $
#
# ChangeLog
# ---------
@leipert
leipert / rules.rb
Last active January 29, 2017 03:16
Full brew and brew cask upgrade cycle in https://github.com/benjaminoakes/maid
#
# Full brew and brew cask upgrade cycle in https://github.com/benjaminoakes/maid
#
Maid.rules do
### Homebrew:
rule 'Updating brew formulas' do
log(`brew update`)
end
@KainokiKaede
KainokiKaede / moves-fetch.py
Last active May 5, 2018 23:28
These scripts fetch storyline from Moves (http://moves-app.com/) and convert it into gpx file. moves-fetch.py does the first task, and movesjson2gpx.py does the second. To execute moves-fetch.py, you have to sign in to Moves as a developer (https://dev.moves-app.com/login). For further instruction, please read the comments and the code itself. F…
"""
1. Go to https://dev.moves-app.com/apps and register a new app.
client_id and client_secret will be given, so paste it to the variables below.
2. `$ python moves-fetch.py --requesturl` will open the web browser.
Follow the instructions and authenticate the app.
You will be redirected to a web page with an error message.
Copy the string between `code=` and `&`.
That is your request_token, so paste it below.
3. `$ python moves-fetch.py --accesstoken` will output access token to stdout.
Copy the token and paste it below.
@agaviria
agaviria / Ledger_3_commands.dat
Created August 10, 2012 20:03
Collection of ledger-cli commands
# comments example for .dat or .ledger files
@smallexample
; This is a single line comment,
# and this,
% and this,
| and this,
* and this.
# If you have a deeply nested tree of accounts,
# it may be convenient to define an alias, for example:
@bobthecow
bobthecow / rules.rb
Last active April 27, 2023 16:43
Maid rules
# https://github.com/benjaminoakes/maid
Maid.rules do
## Trash a bunch of downloaded stuffs ##
rule 'Trash duplicate downloads' do
# Keep the dupe with the shortest filename
trash verbose_dupes_in('~/Downloads/*')
end
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
@thbar
thbar / how-to-diff-pdf-files-with-git-and-diffpdf.md
Last active November 3, 2023 06:01
How to diff PDF files with Git

One can use MD5 or plain text diff to see differences in PDF files. If that's not enough, here's how to use diff-pdf which knows how to diff based on appearance or words:

  • brew install diff-pdf
  • edit your ~/.gitconfig to add this:
[difftool "diffpdf"]
  cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"
@migurski
migurski / merge-geojsons.py
Created September 21, 2012 03:43
Merge multiple GeoJSON files into one
from json import load, JSONEncoder
from optparse import OptionParser
from re import compile
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
parser = OptionParser(usage="""%prog [options]
Group multiple GeoJSON files into one output file.
@mblondel
mblondel / svm.py
Last active November 13, 2023 13:17
Support Vector Machines
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
@klange
klange / _.md
Last active December 2, 2023 20:36
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le