Skip to content

Instantly share code, notes, and snippets.

View carlinmack's full-sized avatar
🏴󠁧󠁢󠁳󠁣󠁴󠁿

Carlin MacKenzie carlinmack

🏴󠁧󠁢󠁳󠁣󠁴󠁿
View GitHub Profile
function baz() {
let val;
return function bar() {
if (val === undefined) {
console.log('working');
val = ['values', 'values']
return val;
} else {
return val;
}
@carlinmack
carlinmack / ArraysAndHashes.md
Last active July 3, 2019 14:34
Perl Arrays and Hashes
Creation Reference Dereference
Array @array = () $ref = []
@array = ('one', two) $value = $array[$index];
$ref = ['one', 'two'] $value = $ref->[$index];
@array[0] = 'one' $ref->[0] = 'one'
$ref = \@foo @new_array = @{$ref}
Hash %hash = () $ref = {}
%hash = (key => 'value') $value = $hash{key}
$ref = {key => 'value'} $value = $ref->{key}
@carlinmack
carlinmack / VScodeAndSSH.md
Last active June 5, 2024 18:10
VS Code and SSH
" show the filename in the window titlebar
set title
" set encoding
set encoding=utf-8
" line numbers
set number
highlight LineNr ctermfg=DarkGrey
# Change prefix bind
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Enable mouse mode (tmux 2.1 and above)
keycode 0x0a = 1 at
keycode 0x0b = 2 numbersign
keycode 0x0c = 3 sterling
keycode 0x0d = 4 dollar EuroSign EuroSign
keycode 0x0e = 5 percent
keycode 0x0f = 6 asciicircum
keycode 0x10 = 7 ampersand
keycode 0x11 = 8 asterisk
keycode 0x12 = 9 parenleft
keycode 0x13 = 0 parenright
@carlinmack
carlinmack / cloudSettings
Last active June 26, 2020 13:11
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-06-14T21:26:38.490Z","extensionVersion":"v3.4.3"}

AutoHotkey QuickStart Guide

Setup

You wanna download the current version of autohotkey, I'd recommend V2 but I have no idea what the syntax is. After downloading I think it will create a script for you called something like "AutoHotkey.ahk". You can place this anywhere but I put it in my Documents. Once you've found a place for it you will want to copy it. Then go to C:\Users\%UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. Finally right click and select "Paste shortcut". This will ensure that AutoHotkey runs on start up.

Editing your user script

To make any adjustments, which will be many at the start, find the AHK icon in the notification area. Right click and select "Edit This Script". This will open notepad for you to make changes in. Once you are done save and then right click the AHK icon and select "Reload This Script"

# place this file in folder with pngs or jpgs
# run with python warmingstripes.py
# will work with non warming stripes images
# but will be an image with columns of the top row of pixels stretched down
from PIL import Image
import drawSvg as draw
import os
files = [i for i in os.listdir() if i.endswith("png") or i.endswith("jpg")]
@carlinmack
carlinmack / dois.py
Last active June 8, 2022 12:32
IPCC AR6 2022 QIDs
"""
If query.sparql and the input data file are downloaded,
the script can simply be called as:
python iq-to-qid.py
"""
import argparse
import os
import time