Skip to content

Instantly share code, notes, and snippets.

@jb55
jb55 / xml-lenses.hs
Created July 14, 2014 08:32
conduit xml lenses
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Applicative
import Control.Lens
import Data.Text (Text)
import Text.Xml.Lens
import Text.XML
import qualified Data.Text.Lazy.IO as T
xmlCardType :: Fold Element CardType
xmlCardType = node "Tag"
.attributed (ix "type" . only "CardType")
.attr "value"
._Just
.to decimal
._Right
._1
.isoCardType

Keybase proof

I hereby claim:

  • I am monstercat on github.
  • I am monstercat (https://keybase.io/monstercat) on keybase.
  • I have a public key whose fingerprint is 0F6D 8E5A B131 42E3 4582 6983 A924 D045 8769 235E

To claim this, I am signing this object:

type Error = Text
type Url = Text
downloadPage :: Url -> IO (Either Error Text)
downloadPage url = -- ...
operations :: [Url] -> IO ()
operations urls = do
pages :: [Either Error Text]
@jb55
jb55 / bquery-extensible-views.coffee
Created October 20, 2014 22:27
Extensible view in bquery
Ratio = require('ratio')
EditableRatioPlugin = (v) ->
v.defaults 'editable-ratio',
rawTemplate: require('./template')
noModel: true
v.set "setFrac", (n, d) ->
r = if n instanceof Ratio then n else Ratio(n,d)
@model.set("value", r)
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Test (
geometricMean
) where
import Data.Foldable (Foldable)
import qualified Data.Foldable as F
@jb55
jb55 / galaxy.vim
Created December 16, 2014 07:40
Starcraft 2 Galaxy Vim Language Syntax
" SC2 Galaxy Language Syntax File
" Language: Galaxy
" Maintainer: Bill 'jb55' Casarin <jb@jb55.com>
" Last Change: March 3, 2010
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
finish
endif
@jb55
jb55 / ldd.txt
Created February 15, 2015 07:46
$ ldd `which fast-tags` | awk '{ print $3 }' | tail -n+2 | xargs wc -c | sort -n | numfmt --to=si
15K /nix/store/nrxyygy0wqski1klq0305d3h523k41ps-glibc-2.20/lib/libutil.so.1
19K /nix/store/nrxyygy0wqski1klq0305d3h523k41ps-glibc-2.20/lib/libdl.so.2
43K /nix/store/nrxyygy0wqski1klq0305d3h523k41ps-glibc-2.20/lib/librt.so.1
53K /nix/store/cq4qqjii3s9ghr6p59kkrdf44wnyhpp4-ghc-7.8.4/lib/ghc-7.8.4/deepseq-1.3.0.2/libHSdeepseq-1.3.0.2-ghc7.8.4.so
60K /nix/store/cq4qqjii3s9ghr6p59kkrdf44wnyhpp4-ghc-7.8.4/lib/ghc-7.8.4/rts-1.0/libffi.so.6
105K /nix/store/cq4qqjii3s9ghr6p59kkrdf44wnyhpp4-ghc-7.8.4/lib/ghc-7.8.4/old-locale-1.0.0.6/libHSold-locale-1.0.0.6-ghc7.8.4.so
136K /lib/x86_64-linux-gnu/libpthread.so.0
150K /lib64/ld-linux-x86-64.so.2
this.gbar_=this.gbar_||{};(function(_){var window=this;
try{
_.jb=function(a){var c=_.La;c.d?a():c.b.push(a)};_.kb=function(){};_.lb=function(a){_.lb[" "](a);return a};_.lb[" "]=_.kb;
}catch(e){_._DumpException(e)}
try{
var gh;gh=function(a){if(a.classList)return a.classList;a=a.className;return _.t(a)&&a.match(/\S+/g)||[]};_.Q=function(a,c){return a.classList?a.classList.contains(c):_.ra(gh(a),c)};_.R=function(a,c){a.classList?a.classList.add(c):_.Q(a,c)||(a.className+=0<a.className.length?" "+c:c)};
_.hh=function(a,c){if(a.classList)(0,_.ma)(c,function(c){_.R(a,c)});else{var d={};(0,_.ma)(gh(a),function(a){d[a]=!0});(0,_.ma)(c,function(a){d[a]=!0});a.className="";for(var e in d)a.className+=0<a.className.length?" "+e:e}};_.S=function(a,c){a.classList?a.classList.remove(c):_.Q(a,c)&&(a.className=(0,_.na)(gh(a),function(a){return a!=c}).join(" "))};_.ih=function(a,c){a.classList?(0,_.ma)(c,function(c){_.S(a,c)}):a.className=(0,_.na)(gh(a),function(a){return!_.ra(c,a)}).join(" ")};
}catch(e){_._DumpException(
bill: basically that weirnam. Which is all i think as the playlists. <https://hackboffgure.com/dnc7.pgm>
thomas: for what
thomas: :fuuuuct_cquect:
```
With become told of minual accounts <https://genfutera.com/jb55/monstercat.com> user 300
thomas: yea
thomas: say commission 20mo way the extra future insidut things
bill: lenger in the white already view objects
bill: just talking to give the day what we don't would work