Skip to content

Instantly share code, notes, and snippets.

Avatar
🗿
.

Bob Poekert bobpoekert

🗿
.
View GitHub Profile
@bobpoekert
bobpoekert / search_templates
Last active Nov 12, 2020
A machine readable list of search engines. Each line is a query template, where all occurrences of {searchTerms} should be replaced with the search query. These were scraped off mycroft.mozdev.org, and tested that they at least respond with a page that contains the input query (to remove pages that lie behind login walls).
View search_templates
http://0-www.sciencedirect.com.www.consuls.org/science?_ob=QuickSearchURL&_method=submitForm&_acct=C000050221&md5=0c4b6db32507e4a332b2aa6dd47a65f4&qs_all={searchTerms}&qs_author=&qs_title=&qs_vol=&qs_issue=&qs_pages=&x=34&y=15
http://0-dictionary.oed.com.library.utulsa.edu/cgi/findword?query_type=word&queryword={searchTerms}
http://100.daum.net/search/search.do?query={searchTerms}
http://1000corks.com/search?st={searchTerms}&src=myc
http://11870.com/konsulto/{searchTerms}
http://1000memories.com/search?q={searchTerms}
http://130.219.35.129/search?q={searchTerms}&btnG=Google+Search&entqr=0&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&client=default_frontend&ud=1&oe=UTF-8&ie=UTF-8&proxystylesheet=default_frontend&site=default_collection
http://1337x.org/search/{searchTerms}/0/
http://11888.ote.gr/web/guest/white-pages/search?who={searchTerms}&where=
http://140.111.34.46/cgi-bin/newDict/dict.sh?idx=dict.idx&cond={searchTerms}&pieceLen=50&fld=1&cat=&imgFont=1
View yt_pop_greasemonkey.js
// ==UserScript==
// @name remove popular videos
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*.youtube.com/
// @grant none
// ==/UserScript==
View t.js
setInterval(function() { var s = document.querySelectorAll('path[d="M20.75 2H3.25C2.007 2 1 3.007 1 4.25v15.5C1 20.993 2.007 22 3.25 22h17.5c1.243 0 2.25-1.007 2.25-2.25V4.25C23 3.007 21.993 2 20.75 2zM17.5 13.504c0 .483-.392.875-.875.875s-.875-.393-.875-.876V9.967l-7.547 7.546c-.17.17-.395.256-.62.256s-.447-.086-.618-.257c-.342-.342-.342-.896 0-1.237l7.547-7.547h-3.54c-.482 0-.874-.393-.874-.876s.392-.875.875-.875h5.65c.483 0 .875.39.875.874v5.65z"]'); for (var i=0; i < s.length; i++) { var e = s[i].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; e.parentElement.removeChild(e); }}, 200);
View liked.js
setInterval(function() { if (window.location.pathname == '/home') { var s = document.querySelectorAll('path[d="M12 21.638h-.014C9.403 21.59 1.95 14.856 1.95 8.478c0-3.064 2.525-5.754 5.403-5.754 2.29 0 3.83 1.58 4.646 2.73.814-1.148 2.354-2.73 4.645-2.73 2.88 0 5.404 2.69 5.404 5.755 0 6.376-7.454 13.11-10.037 13.157H12z"'); for (var i=0; i < s.length; i++) { var e = s[i]; var ee = e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; ee.parentNode.removeChild(ee); }}}, 200);
View slippy.ml
(* https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels *)
let pi = 3.1415926535897932384626433832795028841
let tile_number zoom lat lon =
let n = 2. ** (float_of_int zoom) in
(* return (Math.floor((tt+180)/360*Math.pow(2,zoom1))); *)
let xtile = int_of_float (floor ((lon +. 180.) /. 360. *. n)) in
(* (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom2))) *)
View spectral_cluster.py
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.decomposition import TruncatedSVD
import sklearn.cluster as cl
import sys
import os
import threading
from multiprocessing import cpu_count
# your input (graph.bin) represents a set of pairwise counts (thing a, thing b, count)
View shade.py
def shade(points, width=1280, height=1024):
max_x = np.max(points[:, 0])
max_y = np.max(points[:, 1])
min_x = np.min(points[:, 0])
min_y = np.min(points[:, 1])
bin_width = (max_x - min_x) / width
bin_height = (max_y - min_y) / height
View algae.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bobpoekert
bobpoekert / linux_memory.py
Created Jan 13, 2013
Get info about available memory from Python on Linux.
View linux_memory.py
def memory_info():
res = {}
for row in open('/proc/meminfo', 'r'):
k, v = row.split(':')
k = k.strip()
v = v.split()
if len(v) == 1:
v = int(v[0])
elif v[1] == 'kB':
v = int(v[0]) * 1024
View pdf_urls.txt
This file has been truncated, but you can view the full file.
https://www.pdf-archive.com/2011/01/01/great-big-hug-cowl-pattern-version-1/great-big-hug-cowl-pattern-version-1.pdf
https://www.pdf-archive.com/2011/01/01/brentsteinbergillustrations/brentsteinbergillustrations.pdf
https://www.pdf-archive.com/2011/01/01/summing-up-transfers-on-january-1st/summing-up-transfers-on-january-1st.pdf
https://www.pdf-archive.com/2011/01/03/10-retro/10-retro.pdf
https://www.pdf-archive.com/2011/01/03/10-vol/10-vol.pdf
https://www.pdf-archive.com/2011/01/03/progress-report-28-12-2010/progress-report-28-12-2010.pdf
https://www.pdf-archive.com/2011/01/03/guide/guide.pdf
https://www.pdf-archive.com/2011/01/03/dating-relationships-and-all-that-awkward-stuff/dating-relationships-and-all-that-awkward-stuff.pdf
https://www.pdf-archive.com/2011/01/04/q1-and-q2/q1-and-q2.pdf