Skip to content

Instantly share code, notes, and snippets.

@thebigbad
thebigbad / gist:f153344755783118bd293fffe2d37de2
Last active July 22, 2021 20:55
script that takes a list of accounts and tries to webfinger an exemplar from each domain
import requests
import urllib
import sys
domains = {}
for line in open(sys.argv[1], 'r'):
user = line.strip()
domains[user.split('@')[1]] = user

Keybase proof

I hereby claim:

  • I am thebigbad on github.
  • I am 5000lobsters (https://keybase.io/5000lobsters) on keybase.
  • I have a public key ASBdhQ4Egqspx5UsaYEuMgqLqoyrl761WSHoWLSjg-S-vAo

To claim this, I am signing this object:

// http://simonenko.su/8169320732/node-tumblr-my-first-nodejs-module
var Tumblr = require('tumblr').Tumblr,
fs = require('fs');
var blog = new Tumblr(
'YOURTUMBLELOG.tumblr.com',
'YOURAPIKEY');
var get = function(offset) {
offset = offset || 0;
        (\(\_
     _.o o`\\\\
    ("_     ))))
     '---'  ((((          .=,
         )   )))___.-""-./=;\\\
        /    (((         \  )))) 
       ;                  | |//
       /\          |      | ((
      (  \    /__.-'\    /   )
     / /` |  /    \  \  |
@thebigbad
thebigbad / glitch.rb
Created August 5, 2012 07:10
save random glitch image from flikr's glitches pool to file
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
index_url = 'http://www.flickr.com/groups/glitches/pool/'
index = Nokogiri::HTML(open(index_url))
image_urls = index.css('a[class="rapidnofollow"] img').to_a
image_url = image_urls[rand(image_urls.length)]['src']
[beets]
directory: ~/library/music
library: ~/library/music/library.blb
import_delete: yes
import_quiet_fallback: skip
# where to save complete downloads
directory = ~/incomplete/music/data
# directory for tracking tracker state
session = ~/incomplete/music/session
# port range. make sure this is different for every client you run on your machine
port_range = 6890-6999
# listen for files added to the watch directory
<head>
<title>rawr, titles</title>
<link rel="author" href="https://plus.google.com/111613279767967609772" />
</head>
<body>
...
</body>
</html>
func authorized(r *http.Request) bool {
h := r.Header.Get("Authorization")
_, password, err := basicauth.Decode(h)
if err != nil {
return false
}
c := appengine.NewContext(r)
k := datastore.NewKey(c, "Password", "password", 0, nil)
p := new(Password)
if err := datastore.Get(c, k, p); err != nil {
@thebigbad
thebigbad / gist:1735965
Created February 4, 2012 06:57
download all public tweets of a twitter user
var http = require('http'),
querystring = require('querystring'),
fs = require('fs');
var screenname = '5000lobsters';
fs.mkdirSync(process.cwd() + '/tweets');
var getTweets = function(screenname, page) {
page = page || 0;