Skip to content

Instantly share code, notes, and snippets.

View smt's full-sized avatar

Stephen Tudor smt

View GitHub Profile
@smt
smt / STOP_INSTALLING_OFFICE_ONLINE.ahk
Created October 25, 2020 22:57
AutoHotkey script that disables the ANNOYING "feature" in Windows 10 that re-installs Office Online every time a user chords CTRL+SHIFT+ALT+WIN. Source: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_other-msoffice_custom-msoversion_other/disable-office-on-line-ctrlshiftaltwin-shortcut/edfd9f4e-6a20-4ab7-9ddd-de0a62c3c646?auth=1
#HotkeyInterval 2000 ; This is the default value (milliseconds).
#MaxHotkeysPerInterval 200
#^!Shift::
#^+Alt::
#!+Ctrl::
^!+LWin::
^!+RWin::
Send {Blind}{vk07}
return
@smt
smt / checksum.js
Created December 4, 2017 15:22
AoC 2017 - Day 2
function prepare(data) {
return data
.split('\n')
.map(x => x
.split('\t')
.map(Number)
);
}
function findMinMax(nums) {
@smt
smt / beat.sh
Last active October 12, 2017 14:04
#!/bin/sh
# Output the current time in Swatch Internet Time "beats"
# See: https://en.wikipedia.org/wiki/Swatch_Internet_Time
# Example output:
# @811
# Helper conversion function
# @param naive time as HH:MM:SS string
# @param [-c] to include "centibeats"
@smt
smt / twtxt.txt
Last active September 24, 2017 02:28
twtxt.txt
2017-09-24T02:00:46.000000Z So there I was, minding my own business, when a friend told me of twtxt and I just had to give it a try at least this once.
@smt
smt / keybase.md
Created September 13, 2017 19:44

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""" AUTOCMD """"""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has('autocmd')
augroup general_buffer
au!
au BufReadPost setlocal nobomb
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
@smt
smt / gh-whitespace-bookmarklet.txt
Last active May 5, 2017 20:07
GitHub magic query params
javascript:(function(w)%7Bvar%20W%3D1%2CTS%3D4%2Cl%3Dw.location%2Cqs%3Bif(l.search)%7Bqs%3Dl.search.split(\'%3F\')%5B1%5D.split(\'%26\').reduce(function(acc%2Cp)%7Bvar%20kv%3Dp.split(\'%3D\')%3Bacc%5Bkv%5B0%5D%5D%3Dkv%5B1%5D%3Breturn%20acc%7D%2C%7B%7D)%3Bqs.w%3DW%3Bqs.ts%3DTS%3Bl.search%3D\'%3F\'%2B(Object.keys(qs).reduce(function(acc%2Ck)%7Bacc.push(k%2B\'%3D\'%2Bqs%5Bk%5D)%3Breturn%20acc%7D%2C%5B%5D).join(\'%26\'))%7Delse%7Bl.search%3D\'%3Fw%3D\'%2BW%2B\'%26ts%3D\'%2BTS%7D%7D)(window)
#!/bin/zsh
# Search for, select, and execute command from history DB using FZF
# Inspired by http://junegunn.kr/2015/04/browsing-chrome-history-with-fzf/
h(){
local sep query
sep='{::}'
query="SELECT cmd, count(*) as frequency
FROM hist
GROUP BY cmd
@smt
smt / dict_merge.py
Last active May 17, 2016 12:41 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
:return: None
"""
@smt
smt / bootstrap.sh
Created August 20, 2015 13:23
PTHIELE
#!/bin/bash
SRC_DIRECTORY="$HOME/Developer"
SSH_DIRECTORY="$HOME/.ssh"
ANSIBLE_DIRECTORY="$SRC_DIRECTORY/ansible"
ANSIBLE_CONFIGURATION_DIRECTORY="$HOME/.anthrobasebox"
function pause(){
read -p "$*"
}