This file contains hidden or 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
#!/usr/bin/env python3 | |
#SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB | |
#--------- ------- ---- ------- ----------- ---------- ----------- ----------- | |
solstr = """ | |
base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 | |
base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 | |
base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46 | |
base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51 | |
base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 |
This file contains hidden or 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
fn get_raw_bytes<T>(p: *const T) -> Vec<u8> { | |
// https://www.reddit.com/r/rust/comments/2ngnmk/viewing_any_object_as_a_raw_memory_array/ | |
let size = std::mem::size_of::<T>(); | |
let mut buf = Vec::with_capacity(size); | |
let view = p as *const _ as *const u8; | |
for i in 0..size { | |
buf.push(unsafe {*view.offset(i as isize)}); | |
} | |
buf | |
} |
This file contains hidden or 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 RelaxedPolyRec, FlexibleInstances, TypeSynonymInstances #-} | |
-- RelaxedPolyRec needed for inlinesBetween on GHC < 7 | |
{- | |
Copyright (C) 2012-2015 John MacFarlane <[email protected]> | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. |
This file contains hidden or 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
# ref.) http://www.andrews-corner.org/abcde.html | |
ACTIONS=cddb,playlist,read,encode,tag,move,clean | |
# cddb | |
CDDBURL="http://freedbtest.dyndns.org/~cddb/cddb.cgi" | |
CDDBCOPYLOCAL="y" | |
CDDBLOCALDIR="/data/media/abcde/cddb" | |
CDDBLOCALRECURSIVE="y" | |
CDDBUSELOCAL="y" |
This file contains hidden or 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 io | |
import subprocess | |
import functools | |
import copy | |
import os | |
import sys | |
from collections import ChainMap | |
__version__ = '0.0.1' | |
_debug = False |
This file contains hidden or 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
export type State<Source> = { | |
source: Source; | |
position: number; | |
completed: boolean; | |
}; | |
export function State<Source>( | |
source: Source, | |
position?: number | |
): State<Source> { |
This file contains hidden or 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
#!/usr/bin/env bash | |
# for GNU bash 3.x on Linux | |
declare PROGRAM_NAME="$(basename "$0")" | |
declare PROGRAM_DIR="$(realpath "$(dirname "$0")")" | |
function usage () { | |
cat <<EOF | |
${PROGRAM_NAME} - some nice program |
This file contains hidden or 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
set -eu | |
PROGRAM="$(basename "$0")" | |
usage () { | |
cat <<EOF | |
${PROGRAM}: diff then cp | |
Usage: | |
${PROGRAM} [-f|-i] SRC DEST |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu | |
PROGRAM="$(basename "$0")" | |
usage () { | |
cat <<EOF | |
${PROGRAM}: diff then cp | |
Usage: |
This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"os" | |
log "github.com/sirupsen/logrus" |