I hereby claim:
- I am samstokes on github.
- I am samstokes (https://keybase.io/samstokes) on keybase.
- I have a public key ASBjVCcl1P5w4m-tmbthV5BAb3AOcY4g2Uxu3v7G6e8kXAo
To claim this, I am signing this object:
def methods_returning(answer, *args) | |
# probably want to filter out some methods | |
# e.g. ones that mutate their receiver... | |
blacklist = %w() | |
(methods - blacklist).select do |method| | |
guinea_pig = begin | |
clone | |
rescue TypeError => e | |
raise unless e.message =~ /can't clone/ |
# Hmmm | |
DG::loop_until { url.present? && chunks_done < 25 }.body do | |
make_http_request(stuff, things, other_things).safe_callback do |blah| | |
blah | |
end | |
end.transform | |
# Yum | |
DG::loop_until(lambda { url.present? && chunks_done < 25 }) do | |
make_http_request(stuff, things, other_things).safe_callback do |blah| |
EM.run do | |
fetch('http://google.com/search?q=deferrable_gratification').bind! do |doc| | |
fetch((doc / 'ol' / 'li' / 'a')[0][:href]) | |
end.bind! do |doc| | |
fetch((doc / '#repository_homepage').at(:a)[:href]) | |
end.callback do |doc| | |
puts doc.at(:title).inner_text | |
# now the previous 'doc's aren't in scope, so I can't accidentally | |
# refer to them | |
end.errback do |error| |
# This is a large amount of Ruby code | |
# No, really, it is | |
# Can't you tell? | |
def foo(bar) | |
baz(bar) | |
end | |
# That was a large amount of Ruby code | |
# Wiffle bamble boo |
sstokes@sstokes-mba-ubuntu:gittest$ git log --all --decorate --graph --oneline | |
* 15e2132 (refs/stash) WIP on master: 2e83ed8 initial commit | |
|\ | |
| * 61442a1 index on master: 2e83ed8 initial commit | |
|/ | |
* 2e83ed8 (HEAD, master) initial commit |
#!/usr/bin/env bash | |
set -e | |
if [[ $# > 0 ]]; then | |
case "$1" in | |
-h | -\? | --help ) | |
{ | |
echo "Add a todo:" | |
echo " todo Reformulate the widget plans." |
I hereby claim:
To claim this, I am signing this object:
import logging | |
logging.basicConfig() | |
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) |
Script to parse Disqus Comment Export XML as documented at
https://help.disqus.com/en/articles/1717164-comments-export
and translate it into a JSON format that is easier to handle (for example, using Jekyll's built-in support for JSON files in _data
).
The imagined use case is if you have decided to remove Disqus comments from your blog (or maybe disable commenting entirely), but have existing comments on previous posts that you want to keep. You can export your comments from Disqus, and statically render the historical comments, without needing any Disqus Javascript or cookies.
The Disqus XML exports all categories, threads and posts into flat lists, with id references for parent relationships. That makes it complicated to do things like "look up all comments on this blog post", or see which comments were in reply to which,