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
# This is Kev's slate file | |
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config windowHintsIgnoreHiddenWindows false | |
config windowHintsShowIcons true | |
config windowHintsDuration 10 | |
config focusPreferSameApp 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Remap CapsLock to Hyper</name> | |
<appendix>OS X doesn't have a Hyper. This maps Left Control to Control + Shift + Option + Command.</appendix> | |
<identifier>space_cadet.left_control_to_hyper</identifier> | |
<autogen> | |
--KeyToKey-- KeyCode::F19, KeyCode::COMMAND_L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L |
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
#!/bin/sh | |
PREFIX=$1 | |
while [ 1 ];do | |
for f in $PREFIX*;do | |
if ! lsof $f >/dev/null;then | |
echo $f is ready | |
# do something with it, then rm/mv it out of the way... | |
... | |
fi |
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
@GET | |
@Path("/urlfetch/{url}") | |
public Response urlFetch(@PathParam("url") String userUrl) { | |
String result = ""; | |
try { | |
URL url = new URL("https://" + userUrl); | |
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); | |
// Header is "Basic <base64 encoded username:password>" | |
// e.g. echo "kevin:password" | openssl env -base64 will give you this |
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
?- use_module(library(clpfd)). | |
/* type go(200, Answer) to run the program. 200 is the highest side */ | |
/* length it will look for. */ | |
go(Top, [L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14, | |
L15,L16,L17,L18,L19,L20,L21,L22,L23,L24,L25]) :- | |
/* Start the timer */ |
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
?- use_module(library(clpfd)). | |
/* | |
Load: ['witch.prolog']. | |
Run: witch(5,Result). | |
*/ | |
witch(Top, Vars) :- | |
Vars = [L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14, | |
L15,L16,L17,L18,L19,L20,L21,L22,L23,L24,L25], |
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
#!/bin/sh | |
set -e | |
usage() { | |
echo "$0 <backup-media> <source-dir> [<source-dir>...]" | |
echo "where backup-media = directory to backup to" | |
echo "and source-dir = one or more directories to backup" | |
} | |
get_last_id() { |
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
# Assumes you've installed the nordvpn zip file into /etc/openvpn | |
# | |
# To use: | |
# 1) create a file /etc/openvpn/nordvpn with username on line 1, password on line 2 | |
# 2) source this into your shell | |
# 3) Run: | |
# vpn # defaults to a random VPN in the UK | |
# vpn nl # connects to random VPN in Netherlands | |
# vpn uk1 # connects to random VPN starting with 'uk1' |
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
# Put this at the end of /etc/default/openvpn | |
AUTOSTART="nordvpn" | |
prefix=uk[0-9][0-9] | |
VPN_HOME=/etc/openvpn | |
target=`ls $VPN_HOME/${prefix}.nordvpn*udp*|shuf -n 1` | |
VPN_CONF=$VPN_HOME/nordvpn.conf | |
cp $target $VPN_CONF | |
sed -i "s/auth-user-pass.*/auth-user-pass \/etc\/openvpn\/nordvpn-auth/" $VPN_CONF | |
echo "up $VPN_HOME/update-resolv-conf" >> $VPN_CONF |
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 ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"golang.org/x/oauth2/google" | |
"google.golang.org/api/oauth2/v2" |
OlderNewer