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
#!/bin/bash | |
# A simple password generator that uses a combination of /dev/urandom, | |
# tr, head, and xclip to quickly generate a reasonably random password | |
## strict bash mode | |
set -euo pipefail | |
IFS=$'\n\t' | |
## pwgen [count] [allowed-symbols] |
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
#!/bin/bash | |
# Read the playlist in a line at-a-time from the 4th file descriptor. | |
# This preserves stdin for mpv below, so mpv can still receive | |
# keyboard commands. | |
while read -r -u 4 songPath; do | |
duration=$( | |
ffmpeg -i "$songPath" |& ## use ffmpeg in info mode | |
grep Duration | ## use `cut` to parse the song duration | |
cut -d, -f 1 | ## "Duration: 00:02:21.234" |
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
;;; poe-filter-mode --- a path of exile filter file mode | |
;;; Commentary: | |
;;; not much to say | |
;;; Code: | |
;; forward declare some vars | |
(defvar poe-filter-font-lock nil "Font faces for filter files") | |
(defvar poe-filter-mode-syntax-table nil "Syntax for filter files") |
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
create type gene as enum ( | |
'adaptive_cells', | |
'agility', | |
'aquatic_celerity', | |
'aquatic_homeostasis', | |
'assimilation', | |
'avian', | |
'bioluminescent', | |
'chloroplast_boost', | |
'corrosive', |
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
-- my prelude | |
:set -XNoImplicitPrelude | |
import Prelude ((++), return, ($)) | |
import YNotPrelude | |
-- syntax | |
:set -XBinaryLiterals | |
:set -XLambdaCase | |
:set -XTupleSections | |
:set -XNegativeLiterals |
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
create extension "uuid-ossp"; | |
create type herb as enum ( | |
'daybloom', | |
'moonglow', | |
'blinkroot', | |
'waterleaf', | |
'deathweed', | |
'shiverthorn', | |
'fireblossom' |
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
-- make psql really quiet while the next several commands are processed | |
\set QUIET 1 | |
-- a colorful prompt that displays, in order: | |
-- * hostname (green) | |
-- * port number (yellow) | |
-- * user (blue) | |
-- * database (purple) | |
-- in the format: host:port user@db# | |
\set PROMPT1 '%[%033[1;32m%]%M:%[%033[1;33m%]%> %[%033[1;34m%]%n@%[%033[1;35m%]%/%R%[%033[0m%]%# ' |
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
{-# START_FILE {{name}}.cabal #-} | |
name: {{name}} | |
version: 0.1.0.0 | |
synopsis: Initial project template from stack | |
description: Please see README.md | |
license: GPL-3 | |
license-file: LICENSE | |
author: {{author-name}}{{^author-name}}Author name here{{/author-name}} | |
maintainer: {{author-email}}{{^author-email}}[email protected]{{/author-email}} | |
copyright: {{copyright}}{{^copyright}}{{year}}{{^year}}2017{{/year}} {{author-name}}{{^author-name}}Author name here{{/author-name}}{{/copyright}} |
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 ExistentialQuantification #-} | |
{-# LANGUAGE GADTs #-} | |
module Spreadsheet where | |
import Data.Text | |
import Data.Word | |
import Data.Vector | |
newtype Row = Row Word32 | |
newtype Col = Col Word32 |
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 OverloadedStrings #-} | |
module Json ( | |
Value, | |
-- core API | |
true, false, nil, number, text, array, object, | |
-- utils and demo | |
objects, (.:), jprint, run | |
) where | |
import Data.Monoid |
NewerOlder