Skip to content

Instantly share code, notes, and snippets.

@Wizek
Wizek / deptree.py
Last active August 29, 2015 14:26 — forked from aszlig/deptree.py
Generate GraphViz dependency tree of a TaskWarrior task.
#!/usr/bin/env python
import sys
from subprocess import Popen, PIPE
from json import loads
class Task(object):
def __init__(self, data):
self.data = data
src/Utils.hs:26:12:
No instance for (Stream s0 m0 Char) arising from a use of ‘noneOf’
The type variables ‘s0’, ‘m0’ are ambiguous
Relevant bindings include
nonComma :: ParsecT s0 u m0 Char (bound at src/Utils.hs:26:1)
Note: there are several potential instances:
instance Monad m =>
Stream
bytestring-0.10.6.0:Data.ByteString.Internal.ByteString m Char
-- Defined in ‘Text.Parsec.Prim’
➜ parse-hs git:(master) ✗ cabal install haskell-src-meta
Resolving dependencies...
Configuring mtl-2.2.1...
Building mtl-2.2.1...
Preprocessing library mtl-2.2.1...
[ 1 of 22] Compiling Control.Monad.Writer.Class ( Control/Monad/Writer/Class.hs, dist/dist-sandbox-40525ad4/build/Control/Monad/Writer/Class.o )
[ 2 of 22] Compiling Control.Monad.State.Class ( Control/Monad/State/Class.hs, dist/dist-sandbox-40525ad4/build/Control/Monad/State/Class.o )
[ 3 of 22] Compiling Control.Monad.Reader.Class ( Control/Monad/Reader/Class.hs, dist/dist-sandbox-40525ad4/build/Control/Monad/Reader/Class.o )
[ 4 of 22] Compiling Control.Monad.RWS.Class ( Control/Monad/RWS/Class.hs, dist/dist-sandbox-40525ad4/build/Control/Monad/RWS/Class.o )
[ 5 of 22] Compiling Control.Monad.Identity ( Control/Monad/Identity.hs, dist/dist-sandbox-40525ad4/build/Control/Monad/Identity.o )
data NamedValue a = NamedValue String a
instance Show a => Show (NamedValue a) where
show (NamedValue label a) = label ++ ".: " ++ show a
name .: value = NamedValue name value
@Wizek
Wizek / transcript.txt
Created December 13, 2014 11:09
Astra Taylor - The Unschooled Life (RAPIDFIRE LuRnINg DUBMIX) https://www.youtube.com/watch?v=axoJSMwoXn4
00:00 When my mother was around 12 years old
00:02 She enrolled at an alternative boarding school
00:04 A place that was part of a radical education movement
00:06 that emphasized unmediated experience
00:08 over instruction and authority
00:09 it was governed by a democratic system
00:11 that put students and teachers on equal footing
00:13 a few were even dating
00:14 and the school's primary goal
00:15 was inspiring students to participate in the running of their own lives
stressTestJasmineGiven = (ttl) ->
# console.log ttl
if ttl == 0 then return
describe 'name', ->
Given -> @json = dummyData()
# Then -> expect(typeof dummyData()).toBe('object')
Then -> expect(typeof @json).toBe('object')
stressTestJasmineGiven(ttl - 1)
stressTestJasmineGiven(ttl - 1)
@Wizek
Wizek / index.js
Last active August 29, 2015 14:10
Chrome Download Fail -- Fail
var express = require('express')
var app = express()
app.get('/', function (req, res) {
res.write('<a href="/test.mp3" download target="_blank">test</a>')
res.end()
})
app.get('/test.mp3', function (req, res) {
res.set("Content-Disposition", "attachment;filename=test.mp3")
app.get('/test', function (req, res) {
res.set("Transfer-Encoding", "chunked")
res.set("Content-type", "text/html")
res.write('2\r\nhi\r\n0\r\n')
res.end()
})
@Wizek
Wizek / gist:b10d8acb930d0c43fa8d
Created November 14, 2014 21:36
e-paper test (kindle, e-ink, rendering, ghosting)
<!doctype html>
<html ng-app ng-init="color='black'; size='small'">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
{{ color }}
{{ size }}
</div>
<table>
<tr>
<td>
<button ng-click="color='white'; size='small'">small white</button>
➜ ~ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
➜ ~ cabal install gtk2hs-buildtools --global
Resolving dependencies...
Downloading hashtables-1.1.2.1...
Configuring hashtables-1.1.2.1...
Building hashtables-1.1.2.1...
Password:
Installing library in /Library/Haskell/ghc-7.8.3-x86_64/lib/hashtables-1.1.2.1