(note: originally written for an email)
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/sh | |
echo "keeping screen awake... (ctrl-c to exit)" | |
# literally move the mouse back and forth every ten minutes | |
while [ true ] | |
do | |
xdotool mousemove_relative --sync -- 1 0 | |
xdotool mousemove_relative --sync -- -1 0 | |
sleep 600 |
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
http { | |
# ... | |
server { | |
server_name yourdomain.com; | |
location / { | |
proxy_pass http://localhost:8888; | |
} | |
} | |
# ... |
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
body { | |
margin: 0; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
min-height: 100vh; | |
} |
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
alias l="ls -AFG" | |
alias ll="ls -lFGhA" | |
alias ..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias res="cd ~/repositories"; | |
alias weather="curl wttr.in" | |
alias vi="nvim" | |
alias vim="nvim" | |
export EDITOR="nvim" |
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
-- Super simple test harness for the FP exam | |
examples :: (a -> b) -> [a] -> [b] | |
examples = map | |
examples2 :: (a -> b -> c) -> [(a,b)] -> [c] | |
examples2 fn cases = [uncurry fn cse | cse <- cases] | |
-- Use them like |
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
// normal fetch (using Promise interface) | |
fetch('http://findoslice.tardis.ed.ac.uk/api/get_token') | |
.then(r => r.json()) | |
.then(r => { | |
console.log(r) // response body | |
}) | |
// normal fetch (using async/await syntax) |
I hereby claim:
- I am pkage on github.
- I am pkage (https://keybase.io/pkage) on keybase.
- I have a public key whose fingerprint is 5D59 9CDD 9CED DCBC 1323 E5F8 298E 9E7D CEFF 1D84
To claim this, I am signing this object:
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int main() { | |
// read our number | |
int number; | |
printf("Input a decimal number: "); | |
scanf("%d", &number); |
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
/** | |
* Simple number guessing game, annotated | |
* @author Patrick Kage | |
*/ | |
// include some standard functions | |
#include <stdlib.h> | |
#include <stdbool.h> | |
// standard input/output |