This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 0.000000] x86/PAT: Configuration [0-7]: WB WT UC- UC WC WP UC UC | |
[ 0.000000] Initializing cgroup subsys cpuset | |
[ 0.000000] Initializing cgroup subsys cpu | |
[ 0.000000] Initializing cgroup subsys cpuacct | |
[ 0.000000] Linux version 4.2.0-18-generic (buildd@lgw01-38) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015 (Ubuntu 4.2.0-18.22-generic 4.2.3) | |
[ 0.000000] Command line: placeholder root=UUID=f3feacbe-ef73-430f-937d-e1232da77e68 ro rootflags=subvol=@ quiet splash pci=biosirq | |
[ 0.000000] KERNEL supported cpus: | |
[ 0.000000] Intel GenuineIntel | |
[ 0.000000] AMD AuthenticAMD | |
[ 0.000000] Centaur CentaurHauls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 0.000000] x86/PAT: Configuration [0-7]: WB WT UC- UC WC WP UC UC | |
[ 0.000000] Initializing cgroup subsys cpuset | |
[ 0.000000] Initializing cgroup subsys cpu | |
[ 0.000000] Initializing cgroup subsys cpuacct | |
[ 0.000000] Linux version 4.2.0-18-generic (buildd@lgw01-38) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015 (Ubuntu 4.2.0-18.22-generic 4.2.3) | |
[ 0.000000] Command line: placeholder root=UUID=f3feacbe-ef73-430f-937d-e1232da77e68 ro rootflags=subvol=@ quiet splash acpi=off | |
[ 0.000000] KERNEL supported cpus: | |
[ 0.000000] Intel GenuineIntel | |
[ 0.000000] AMD AuthenticAMD | |
[ 0.000000] Centaur CentaurHauls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
# This is basically shutil.copyfileobj, but ignoring IO errors when reading. | |
# After doing a simple experiment with btrfs checksumming, I wondered if it was possible | |
# to still read a file that gave error with `cp`. The answer is obviously yes, since | |
# the checksum errors will work at the block-level (thus, why the chunksize is bsize) | |
# If you actually want to recover corrupted files from btrfs, without having to restore | |
# every single file in the fs, you might want to use instead: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from collections import namedtuple | |
Duh = namedtuple('Duh', 'foo bar') | |
json.loads('{"foo":1, "bar":2}', object_hook=lambda x: Duh(**x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constraints: Cabal ==1.22.4.0, | |
HStringTemplate ==0.8.3, | |
HTTP ==4000.2.20, | |
HUnit ==1.3.0.0, | |
HaXml ==1.25.3, | |
QuickCheck ==2.8.1, | |
SHA ==1.6.4.2, | |
acid-state ==0.13.0, | |
aeson ==0.10.0.0, | |
ansi-terminal ==0.6.2.3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constraints: Cabal ==1.22.4.0, | |
HStringTemplate ==0.8.3, | |
HTTP ==4000.2.20, | |
HaXml ==1.25.3, | |
QuickCheck ==2.8.1, | |
SHA ==1.6.4.2, | |
acid-state ==0.13.0, | |
aeson ==0.10.0.0, | |
ansi-terminal ==0.6.2.3, | |
appar ==0.1.4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import singledispatch | |
from collections import Iterable | |
from json import JSONEncoder, dumps | |
json_converter = singledispatch(JSONEncoder().default) | |
json_converter.register(Iterable)(list) | |
class A: | |
def __init__(self, a, b): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name fbchatfix | |
// @match http://*.facebook.com/* | |
// @match https://*.facebook.com/* | |
// ==/UserScript== | |
function addfix() { | |
var script = document.createElement("script"); | |
script.setAttribute("type","text/javascript"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE GADTs #-} | |
module Models where | |
import Database.Persist.Sqlite (runSqlite) | |
-- without the explicit type signature, it fails | |
-- with an ambiguous Control.Monad.IO.Class.MonadIO instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
import System.Environment (getArgs, getEnv) | |
import Control.Exception (catch, SomeException) | |
import Data.Map.Strict (fromList, lookup, findWithDefault, insert, assocs) | |
import Prelude hiding (lookup) | |
partitionPairs' Nothing ys (x:xs) = partitionPairs' (Just x) ys xs | |
partitionPairs' Nothing ys [] = ys | |
partitionPairs' (Just x) ys (y:xs) = partitionPairs' Nothing ((x,y):ys) xs |