Skip to content

Instantly share code, notes, and snippets.

URxvt*geometry: 115x40
urxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:Inconsolata\ for\ Powerline:pixelsize=14:antialias=true
!URxvt*font: xft:Liberation\ Mono:pixelsize=14:antialias=false:hinting=true
!URxvt*font: xft:Terminus:antialias=true:hinting=true
!URxvt*boldFont: xft:Terminus:bold:antialias=false:hinting=true
!URxvt*boldFont: xft:Liberation Mono:bold:pixelsize=14:antialias=false:hinting=true
URxvt*depth: 24
URxvt*borderless: 1
URxvt*scrollBar: false
URxvt*saveLines: 9999
@zxexz
zxexz / HTMLtoPDF.js
Last active February 28, 2017 03:02
!function(){function loadScript(a,b){var c=document.createElement("script");c.type="text/javascript",c.readyState?c.onreadystatechange=function(){"loaded"!=c.readyState&&"complete"!=c.readyState||(c.onreadystatechange=null,b())}:c.onload=function(){b()},c.src=a,document.getElementsByTagName("head")[0].appendChild(c)}loadScript("https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js",function(){eval("$.when(\r\n $.getScript(\"https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js\"),\r\n $.getScript(\"https://github.com/devongovett/blob-stream/releases/download/v0.1.3/blob-stream.js\"),\r\n $.getScript(\"https://fastcdn.org/FileSaver.js/1.1.20151003/FileSaver.min.js\"),\r\n $.getScript(\"https://github.com/niklasvh/html2canvas/releases/download/0.5.0-alpha1/html2canvas.js\"),\r\n $.Deferred(function(deferred) {\r\n $(deferred.resolve);\r\n })\r\n).done(function() {\r\n html2canvas($('body'), {\r\n onrendered: function(canvas) {\r\n var pdf =
import Data.List (group, sort)
import Control.Arrow ((&&&))
nGrams :: Int -> [a] -> [[a]]
nGrams x xs
| null xs = [[]]
| x <= 0 = [[]]
| x == 1 = [[y] | y <- xs]
| x == 2 = map (\ (x, y) -> [x, y]) $ zip xs $ tail xs
| otherwise = zipWith (:) xs (nGrams (x - 1) $ tail xs)
{-# LANGUAGE RecordWildCards #-}
import System.IO
import System.Posix.IOCtl
import System.Posix.IO
import Foreign.Storable
import Foreign.Ptr
import Foreign.C
data Req = Req { c :: CChar }
#
# Author: Eric Marriott
# Date: 10 Feb. 2015
# This file is a much more concise and (in my opinion) prettier version of my original countBigram.py...I thought I improved the algorithm with zip() and a list comprehension, but it runs almost a whole second slower on human22.fasta!
#
# import the system library for file IO
import sys
# first line of fasta file not relevant here, so read that but don't assign it to a variable
f = open(sys.argv[1], 'r')
data SiteCode = C00 | C00_0 | C00_1 | C00_2 | C00_3 | C00_4 | C00_5 | C00_6 | C00_8 | C00_9 | C01 | C01_9 | C02 | C02_0 | C02_1 | C02_2 | C02_3 | C02_4 | C02_8 | C02_9 | C03 | C03_0 | C03_1 | C03_9 | C04 | C04_0 | C04_1 | C04_8 | C04_9 | C05 | C05_0 | C05_1 | C05_2 | C05_8 | C05_9 | C06 | C06_0 | C06_1 | C06_2 | C06_8 | C06_9 | C07 | C07_9 | C08 | C08_0 | C08_1 | C08_8 | C08_9 | C09 | C09_0 | C09_1 | C09_8 | C09_9 | C10 | C10_0 | C10_1 | C10_2 | C10_3 | C10_4 | C10_8 | C10_9 | C11 | C11_0 | C11_1 | C11_2 | C11_3 | C11_8 | C11_9 | C12 | C12_9 | C13 | C13_0 | C13_1 | C13_2 | C13_8 | C13_9 | C14 | C14_0 | C14_2 | C14_8 | C15 | C15_0 | C15_1 | C15_2 | C15_3 | C15_4 | C15_5 | C15_8 | C15_9 | C16 | C16_0 | C16_1 | C16_2 | C16_3 | C16_4 | C16_5 | C16_6 | C16_8 | C16_9 | C17 | C17_0 | C17_1 | C17_2 | C17_3 | C17_8 | C17_9 | C18 | C18_0 | C18_1 | C18_2 | C18_3 | C18_4 | C18_5 | C18_6 | C18_7 | C18_8 | C18_9 | C19 | C19_9 | C20 | C20_9 | C21 | C21_0 | C21_1 | C21_2 | C21_8 | C22 | C22_0 | C22_1 | C23 | C23_9 | C24 | C2
from hashlib import sha256, sha1
from uuid import uuid4
from os import urandom
from Crypto.Cipher import AES
from binascii import b2a_base64
from ctypes import c_int
import numpy as np
zero = np.uint32(0)
_joiner__ = ':'.encode()
@zxexz
zxexz / config
Created October 28, 2017 05:00
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
URxvt*geometry: 115x40
!URxvt*font: xft:Liberation Mono:pixelsize=14:antialias=false:hinting=true
URxvt*font: xft:Terminus:antialias=true:hinting=true
URxvt*boldFont: xft:Terminus:bold:antialias=false:hinting=true
!URxvt*boldFont: xft:Liberation Mono:bold:pixelsize=14:antialias=false:hinting=true
URxvt*depth: 24
URxvt*borderless: 1
URxvt*scrollBar: false
URxvt*saveLines: 9999
URxvt.transparent: true
@zxexz
zxexz / .bashrc
Last active October 18, 2018 20:21
#
# /etc/bash.bashrc
#
#color definitions
#reset
NC='\[\e[0m\]'
BLINK='\[\e[5m\]'
# Normal Colors