Skip to content

Instantly share code, notes, and snippets.

[[1, "China", 1385566537], [2, "India", 1252139596], [3, "United States", 320050716], [4, "Indonesia", 249865631], [5, "Brazil", 200361925], [6, "Pakistan", 182142594], [7, "Nigeria", 173615345], [8, "Bangladesh", 156594962], [9, "Russia", 142833689], [10, "Japan", 127143577], [11, "Mexico", 122332399], [12, "Philippines", 98393574], [13, "Ethiopia", 94100756], [14, "Vietnam", 91679733], [15, "Germany", 82726626], [16, "Egypt", 82056378], [17, "Iran", 77447168], [18, "Turkey", 74932641], [19, "Congo, Democratic Republic of the", 67513677], [20, "Thailand", 67010502], [21, "France", 64291280], [22, "United Kingdom", 63136265], [23, "Italy", 60990277], [24, "Myanmar", 53259018], [25, "South Africa", 52776130], [26, "Korea, South", 49262698], [27, "Tanzania", 49253126], [28, "Colombia", 48321405], [29, "Spain", 46926963], [30, "Ukraine", 45238805], [31, "Kenya", 44353691], [32, "Argentina", 41446246], [33, "Algeria", 39208194], [34, "Poland", 38216635], [35, "Sudan", 37964306], [36, "Uganda", 37578876], [37, "Ca
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / print_numbered_outline.js
Created January 4, 2014 03:41
I use this script to print out the textual content of a fargo.io subtree to the JavaScript Console, numbering each subitem. Example output: 1. A 1.1 A1 1.2 A2 2. B 3. C See http://outliner.smallpicture.com/fargoVerbs.js for more background.
(function(){
var t = Array();
t.push(0);
op.visitSubs (
function (headline, levelnum) {
t[t.length-1] += 1;
console.log(t.join(".") + ". " + headline.getLineText ());
},
function (levelnum) {
@rdhyee
rdhyee / fargo_io_op_visitSubs_starter.js
Created January 3, 2014 20:09
An example invocation of op.visitSubs in Fargo Scripting (http://docs.fargo.io/fargoScripting) to run in the JavaScript console in context of a Fargo.io outline to understand how op.visitSubs works.
op.visitSubs ( //get bodytext
function (headline, levelnum) { // lineCallback
console.log("lineCB -> headline, levelnum: " + headline.getLineText () + ", " + levelnum);
},
function (levelnum) { // indentCallback
console.log("indentCB -> levelnum: " + levelnum);
},
function (levelnum) { // outdentCallback
console.log("outdentCB -> levelnum: " + levelnum);
}
@rdhyee
rdhyee / Moby Dick Or The Whale - Melville Herman.mrexpt
Created November 25, 2013 14:29
An export to list of bookmarks from my bookmarking/highlighting of The Gutenberg edition of *Moby Dick* via Moon+ Reader Pro
549360
indent:false
trim:false
#
1
Moby Dick, or, the whale
/sdcard/Books/MoonReader/Moby Dick Or The Whale - Melville Herman.epub
/sdcard/books/moonreader/moby dick or the whale - melville herman.epub
6
0
@rdhyee
rdhyee / python_math_isnan.ipynb
Created November 23, 2013 15:45
What happens if you do arithmetic with NaN in Python?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / hypothes_is_api.ipynb
Last active December 26, 2015 11:49
first steps at figuring out hypothes.is API -- now can login and page through results
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / minecraft_do.yml
Last active June 9, 2020 03:44
Ansible playbook to launch a digitalocean droplet and then configure it to run Minecraft based on instructions from https://www.digitalocean.com/community/articles/how-to-set-up-a-minecraft-server-on-linux Note that some things are hardwired: the name of the droplet, the version of minecraft
# http://www.ansibleworks.com/docs/modules.html#digital-ocean
# Create a new Droplet
# Will return the droplet details including the droplet id (used for idempotence)
- name: launch DO droplet
hosts: local
gather_facts: False
tasks:
- name: pwd
@rdhyee
rdhyee / digitalocean_ansible_minecraft.ipynb
Last active October 22, 2016 17:42
An IPython notebook that I use to create a digitalocean.com droplet to host a minecraft server. I've currently hardcoded a reference to the Ansible Playbook, which I've posted at https://gist.github.com/rdhyee/66f1aa40b6ea520c9e6e. There's code to use the Ansible Python API to play the playbook -- though clearly I can use the command line to do …
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / taste.yml
Created October 11, 2013 20:56
my version of the ansible playbook taste.yml based on the Ansible chapter of Matt Jaynes' Taste Test (http://devopsu.com/books/taste-test-puppet-chef-salt-stack-ansible.html).
- hosts: all
tasks:
- name: ensure nginx is installed
action: apt pkg=nginx state=present
- hosts: puppy
vars:
baby: puppy
tasks:
- name: ensure nginx is installed