This guide is specifically for pseudo-random number generators (PRNGs) written in JavaScript, and tested in Mac OS X.
Homebrew
| //Requires jQuery - http://code.jquery.com/jquery-1.6.4.min.js | |
| $(document).ready(function() { | |
| var idleMouseTimer; | |
| var forceMouseHide = false; | |
| $("body").css('cursor', 'none'); | |
| $("#wrapper").mousemove(function(ev) { | |
| if(!forceMouseHide) { | |
| $("body").css('cursor', ''); |
| tell application "Finder" | |
| activate | |
| set filePath to (POSIX path of (target of front window as alias)) | |
| set fileAlias to the selection as alias | |
| set fileName to name of fileAlias | |
| do shell script "~/bin/subl " & filePath & fileName | |
| end tell |
| console.reset = function () { | |
| return process.stdout.write('\033c'); | |
| } |
| # Towards a Taxonomy of Twitter Bots | |
| ## Intro | |
| - towards a definition - autonomous non-human agents on Twitter | |
| - critical thinking - MECE, rabbit rule, holding hands | |
| - patterns of behaviour, rather than content | |
| - Twitter largely a textual medium | |
| - crossover between two broadest categories (automated/event-driven), but largely one or the other (maybe?) | |
| - some bots will exhibit both behaviours (active/reactive), but tend to favour one (most commonly, tweeters will also exhibit conversationalist behaviours) |
| // this is the background code... | |
| // listen for our browerAction to be clicked | |
| chrome.browserAction.onClicked.addListener(function (tab) { | |
| // for the current tab, inject the "inject.js" file & execute it | |
| chrome.tabs.executeScript(tab.ib, { | |
| file: 'inject.js' | |
| }); | |
| }); |
REGEX remove blank lines:
FROM: http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/remove_blank_lines.html
FIND:
^(?:[\t ]*(?:\r?\n|\r))+
| import argparse | |
| import string | |
| import requests | |
| import time | |
| parser = argparse.ArgumentParser( | |
| description='Get all Google Suggest results for a query.') | |
| parser.add_argument('query') | |
| parser.add_argument('--sleep', type=float, default=0.1) | |
| parser.add_argument('--verbose', action='store_true') |
| {0: 'tench, Tinca tinca', | |
| 1: 'goldfish, Carassius auratus', | |
| 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
| 3: 'tiger shark, Galeocerdo cuvieri', | |
| 4: 'hammerhead, hammerhead shark', | |
| 5: 'electric ray, crampfish, numbfish, torpedo', | |
| 6: 'stingray', | |
| 7: 'cock', | |
| 8: 'hen', | |
| 9: 'ostrich, Struthio camelus', |