Skip to content

Instantly share code, notes, and snippets.

View brynedwards's full-sized avatar

Bryn Edwards brynedwards

  • Dublin, Ireland
View GitHub Profile
# Vue file
# ‾‾‾‾‾‾‾‾
# Detection
# ‾‾‾‾‾‾‾‾‾
hook global BufCreate .*\.vue %{
set-option buffer filetype vue
set-option buffer formatcmd 'prettier --stdin --parser=vue'
}
def tmux-send-command -docstring "Send command to the repl pane" -params 0..1 %{
nop %sh{
tmux set-buffer -b kak_selection "$1"
kak_orig_window=$(tmux display-message -p '#I')
kak_orig_pane=$(tmux display-message -p '#P')
tmux select-window -t:$(tmux show-buffer -b kak_repl_window)
tmux select-pane -t:.$(tmux show-buffer -b kak_repl_pane)
tmux paste-buffer -b kak_selection
tmux send-keys Enter
tmux select-window -t:${kak_orig_window}
@brynedwards
brynedwards / vimium-settings
Last active December 19, 2019 10:48
Vimium(-FF) settings
Custom key mappings:
unmap b
unmap t
map w scrollUp
map s scrollDown
map e scrollPageUp
map b scrollFullPageUp
map <space> scrollFullPageDown
map t Vomnibar.activateInNewTab
#!/usr/bin/env stack
-- stack --resolver lts-9.0 script
{-# LANGUAGE OverloadedStrings #-}
import Crypto.KDF.PBKDF2
import Data.ByteString.Base16 (encode)
import qualified Data.ByteString.Char8 as C
main :: IO ()
main = C.putStrLn (encode hash)
@brynedwards
brynedwards / surfingkeys.js
Last active September 20, 2017 11:20
Surfingkeys config
// Surfingkeys 0.9.1
/*
for (let k of [ "sb", "sw", "ob"
, "ow", "cp", ";cp"
, ";ap", "spa", "spb"
, "spd", "sps", "spc"
, "spi", "sfr", "zQ"
, "zz", "zR", "ab" , "Q", "q", "ag"
@brynedwards
brynedwards / spotify2xspf.py
Created July 20, 2017 13:58
Script to dump Spotify playlists to xspf files.
"""
Script to dump Spotify playlists to xspf files. Replace the
playlists list and username string with your values. File name
format is <today_filename.xspf>; see line 65. You'll also need
to auth with the Spotify web API; see the Spotipy API docs:
https://spotipy.readthedocs.io/en/latest/#authorization-code-flow
"""
from datetime import date
import xml.etree.ElementTree as ET
#!/usr/bin/env stack
-- stack --resolver lts-8.21 script
{-# LANGUAGE OverloadedStrings #-}
import Web.Spock
import Web.Spock.Config
import Control.Monad.IO.Class
import Data.Monoid
import Data.Text (Text)
@brynedwards
brynedwards / PKGBUILD
Created January 26, 2016 10:30
kotlinc PKGBUILD
# Maintainer: Romain Gautier <romain dot gautier at nimamoh dot com>
pkgname=kotlinc
pkgver=1.0.0_beta
pkgrel=4589
pkgdesc="Kotlin compiler"
arch=('any')
url="https://github.com/JetBrains/kotlin/releases/tag/build-${pkgver//_/-}-$pkgrel"
license=('apache')
groups=()
depends=('java-environment>=6' 'bash')
@brynedwards
brynedwards / datetagger
Created June 1, 2015 18:09
Get date for single tracks from discogs, not always accurate
#!/usr/bin/python2
import sys
import discogs_client
from beets import mediafile
USER_TOKEN = ''
def write_date(track, client):