Skip to content

Instantly share code, notes, and snippets.

View wwqrd's full-sized avatar

Stephen wwqrd

  • United Kingdom
  • 23:27 (UTC +01:00)
View GitHub Profile
// Input
const input = ['a', 'b', 'c', 'd'];
// Output
// const expectedOut = [
// ['a']
// ['a', 'b']
// ['a', 'b', 'c']
// ['a', 'b', 'c', 'd']
// ['b']
@wwqrd
wwqrd / post-checkout
Created November 8, 2018 10:51
Check out submodules automatically
#!/usr/bin/env bash
# in .git/hooks/post-checkout
git submodule update --recursive --init
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}progress,sub,sup{vertical-align:baseline}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}audio:not([controls]){display:none;height:0}img{border-style:none}svg
@wwqrd
wwqrd / make dfu
Last active March 15, 2017 09:28
Planck woes
$ make dfu
WARNING:
Some git sub-modules are out of date or modified, please consider runnning:
git submodule sync --recursive
git submodule update --init --recursive
You can ignore this warning if you are not compiling any ChibiOS keyboards,
or if you have modified the ChibiOS libraries yourself.
Making planck/rev3 with keymap ab and target dfu [WARNINGS]
@wwqrd
wwqrd / gist:0e94790dd18bcac4b9fd
Last active August 29, 2015 14:07
Installing Arch
# Source: https://wiki.archlinux.org/index.php/Beginners%27_Guide#Installation
# Set keyboard layout
loadkeys uk
# Have a look at the disks
lsblk -f
# Wipe disk
sgdisk --zap-all /dev/sda
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.{js,rb,haml,sass}]
indent_style = space
indent_size = 2
@wwqrd
wwqrd / secret.sh
Last active August 29, 2015 14:04
Random secret
cat /dev/random | xxd -p -l 2048 | tr -d '\n'
@wwqrd
wwqrd / keybase.md
Last active February 18, 2019 16:49

Keybase proof

I hereby claim:

  • I am wwqrd on github.
  • I am wwqrd (https://keybase.io/wwqrd) on keybase.
  • I have a public key ASD7NObO3_lT3MXDWtSFUOwf9vtVdWkcpjTz15FUVmv18Qo

To claim this, I am signing this object:

@wwqrd
wwqrd / rename.rb
Created June 3, 2014 16:52
rename with regex
Dir['source/stylesheets/*.less'].each { |x| File.rename(x, x.gsub(/source\/stylesheets\/(.*)\.less/, "source/stylesheets/_\\1.\less")) }
@wwqrd
wwqrd / gist:e7e5d7201cd2b6dde806
Created May 29, 2014 14:49
Prune tmux sessions
tmux list-sessions -F "#{session_name}:#{session_attached}"