Skip to content

Instantly share code, notes, and snippets.

View biesnecker's full-sized avatar

biesnecker

  • Orlando, FL
  • 16:51 (UTC -04:00)
View GitHub Profile

The muzzle grows tighter

Barack Obama and Hillary Clinton condemned both the video and the reaction to it. General Martin Dempsey, then chairman of America’s joint chiefs of staff, contacted Terry Jones, a pastor in Florida who had previously burned a Koran in public, and asked him not to promote the video.

“Consider for a moment: the most senior officer of the mightiest armed forces the world has ever seen feels it necessary to contact some backwoods Florida pastor to beg him not to promote a 13-minute D-movie YouTube upload. Such are the power asymmetries in this connected world,” writes Timothy Garton Ash in “Free Speech”, a fine new book on the subject.


Second, technology firms are having to grapple with horribly complex decisions about censorship. The big global ones such as Facebook and Twitter aspire to be politically neutral, but do not permit “hate speech” or obscenity on their platforms.

@biesnecker
biesnecker / a_billion_voices.md
Last active June 5, 2016 23:45
Notes from "A Billion Voices" by David Moser

asking the question ‘Do you speak Chinese?’ is akin to asking ‘Do you speak Romance?


As the conference wore on, attacks became increasingly personal. Ironically, dialect differences themselves became fuel for the ire of delegates. At one point a member of the southern faction, Wang Rongbao, happened to use a Shanghai expression for rickshaw, huangbao che, which northerner Wang Zhao misheard as a standard Mandarin curse wangba dan ‘son of a bitch’ (literally, ‘turtle’s egg’). Incensed, Wang Zhao proceeded to bare his arms and physically attack Wang Rongbao, pummelling him with his fists and chasing him from the assembly hall.


In 1919 the National Language Dictionary based upon the committee’s compromise standard was published, under the editorship of Wu Zhihui. But before the champagne bottles could be opened, the dictionary immediately came under harsh criticism. Many scholars continued to argue for a system based on the Beijing dialect. Wu, in his typical bombastic fashion, defended all att

@biesnecker
biesnecker / config.rb
Created February 17, 2013 09:31
Wiki-like automatic links for Middleman
# add this to your config.rb
ready do
wikitargets = Hash.new
wikiwords = Hash.new
sitemap.resources.select {|p| p.ext == ".html" }.each do |p|
unless p.data['wikitag'].nil?
wikitargets[p.data['wikitag']] = p.url
end
print(sum([x for x in range(1000) if x % 3 == 0 or x % 5 == 0]))
from math import sqrt, ceil, trunc
# Sieve of Eratosthenes
def seive(max):
nums = range(max + 1)
nums[0] = None
nums[1] = None
for i in range(2, max + 1):
if nums[i]:
c = i * 2
@biesnecker
biesnecker / gist:4313816
Created December 16, 2012 22:45
Putting characters to the screen without a carriage return
def put (s)
print s
STDOUT.flush
end
@biesnecker
biesnecker / rflick.rb
Created December 12, 2012 09:28
Because sometimes you need to get pictures of kittens into your browser from the command line, fast. Usage: rflick.rb "search query" It will open the image in your browser (on OSX)
#!/usr/bin/env ruby
require 'flickraw'
FlickRaw.api_key = "YOUR FLICKR API KEY"
FlickRaw.shared_secret = "YOUR FLICKR SHARED SECRET"
ARGV[0] ||= "kittens"
search_query = ARGV[0]
(server/add-middleware
friend/authenticate
{ :credential-fn (partial creds/bcrypt-credential-fn users)
:workflows [(workflows/interactive-form)]
:login-uri "/login"
:unauthorized-redirect-uri "/login"
:default-landing-uri "/" })
(pre-route [:any "/app/*"] { :as req } (let [id (friend/identity req)]
(when-not (friend/authorized? [::user] id) (friend/throw-unauthorized id {}))))
@biesnecker
biesnecker / bell.clj
Created February 7, 2012 03:01
Bell numbers
(defn bell
"Returns the nth Bell number"
[n]
(cond
(= n 0) 1
(= n 1) 1
:else (reduce + (map #(abs (stirling-2 n %)) (range 0 (inc n))))))
@biesnecker
biesnecker / stirling-dynamic.clj
Created January 31, 2012 03:59
Stirling numbers
(defn- stirling-loop-internal
[^long n ^long k compfunc]
{ :pre [(<= k n)] }
(let [workitems (for [n' (range 1 (inc n)) k' (range 0 (inc (- n k)))
:when (and (>= (- n' k') 0) (>= k (- n' k')))] [n' (- n' k')])]
(loop [current (first workitems) items (rest workitems) results {}]
(cond
(= current [n k]) ((compfunc current results) current)
(= (current 0) (current 1))
(recur (first items) (rest items)