Skip to content

Instantly share code, notes, and snippets.

View osnr's full-sized avatar

Omar Rizwan osnr

View GitHub Profile
#!/usr/bin/env python
import csv
import matplotlib.pyplot as plt
from matplotlib import dates
from datetime import datetime
X = []
Y = []
@osnr
osnr / ascent.dot
Created October 11, 2013 04:11
As Stu Card remembers it, “There was this thread of ideas that led from Vannevar Bush through J. C. R. Licklider, Doug Engelbart, Ted Nelson, and Alan Kay–a thread in the Ascent of Man. It was like the Holy Grail. We would rationalize our mission according to what Xerox needed, and so on. But whenever we could phrase an idea so that it fell on t…
digraph {
"Vannevar Bush" -> "Claude Shannon";
"Claude Shannon" -> "Ivan Sutherland";
subgraph ailab {
rank = same;
edge[dir=none];
"Seymour Papert" -> "Marvin Minsky";
{
"version": "2013-11-10",
"text": "2 / 3 = 0.66667",
"marks": [
{
"from": {
"line": 0,
"ch": 8
},
"to": {
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Test OTR</title>
</head>
<body></body>
<script>
var start = (new Date()).getTime();

Keybase proof

I hereby claim:

  • I am osnr on github.
  • I am osnr (https://keybase.io/osnr) on keybase.
  • I have a public key whose fingerprint is 8B05 2468 DA56 99A1 14AC EDEF 94B0 3760 DB70 6BD7

To claim this, I am signing this object:

@osnr
osnr / Bot.elm
Last active August 29, 2015 13:57
module Bot where
import Birdhouse as BH
port updates : Signal { status : String } -- Signal (BH.StatusUpdate {})
port updates = BH.update . show <~ count (every (10 * second))
import Http
import Graphics.Input as I
import Graphics.Input.Field as F
inp : I.Input F.Content
inp = I.input F.noContent
urlify : String -> String
urlify t = "http://en.wikipedia.org/w/api.php?action=query&format=json&callback=?&titles=" ++ t ++ "&prop=revisions&rvprop=content"

Proposal: Outgoing Element ports and generalizing main

Let's allow outgoing ports to contain Elements, like this:

clicks : Input ()
clicks = Input ()

port takeClicks : Signal Element
port takeClicks = constant &lt;| clickable clicks.handle () (spacer 40 40)
@osnr
osnr / Dfa.hs
Last active August 29, 2015 14:05
import Numeric
import Data.Char
import Data.Monoid
data State = Accept | S1 | S2 deriving (Show)
data Alphabet = Zero | One deriving (Show)
newtype Transition = Transition { runTransition :: State -> State }

The American Negro has the great advantage of having never believed that collection of myths to which white Americans cling: that their ancestors were all freedom-loving heroes, that they were born in the greatest country the world has ever seen, or that Americans are invincible in battle and wise in peace, that Americans have always dealt honorably with Mexicans and Indians and all other neighbors or inferiors, that American men are the world's most direct and virile, that American women are pure. Negroes know far more about white Americans than that; it can almost be said, in fact, that they know about white Americans what parents -- or, anyway, mothers -- know about their children, and that they very often regard white Americans that way. And perhaps this attitude, held in spite of what they know and have endured, helps to explain why Negroes, on the whole, and until lately, have allowed themselves to feel so little hatred. The tendency has really been, insofar as this was possible, to dismiss white people