This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generating push certificates: | |
Go to iOS developer portal, go to "App IDs", open the production app ID and open | |
settings. Click "create certificate" and follow instructions to get | |
aps_production.cer and aps_development.cer. Make sure you use distinctive names | |
with date in the CSR so you can find the things later. | |
Import generated .cer files into keychain. | |
In keychain, select "my certificates" on the left, and expand the "apple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request') | |
var COOKIE = 'session=2.blahblahblah' // copy your site cookie in here | |
var CID = 1234; // copy the connection id here | |
var BID = 1234; // copy the buffer id here | |
var SINCE = +process.env.since // optional: set an environment variable "since" to offset the log | |
get_lines(SINCE); | |
function get_lines(beforeid) { | |
var headers = { 'Cookie': COOKIE } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Given a list of scores, returns the index of one of those items at random, | |
biased towards the items with the highest scores. | |
e.g. random_index_with_bias([84, 62, 61, 67, 45]) | |
To show it works, run it 1,000,000 times: | |
>>> scores = {} | |
>>> for i in range(1000000): |