Skip to content

Instantly share code, notes, and snippets.

@alexcwatt
alexcwatt / .gitignore
Last active April 6, 2025 02:16
Ruby SQLite query plan regression
*.sqlite
@alexcwatt
alexcwatt / esv.ahk
Last active March 7, 2024 17:38
ESV AutoHotkey
;; ESV Verse Lookup (Windows Key + B for Bible)
;; https://alexcwatt.com/esv-autohotkey
#b::ESV()
ESV() {
static whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
, API_KEY := "YOUR TOKEN HERE"
, url := "https://api.esv.org/v3/passage/text/?"
. "include-passage-references=false&"
. "include-verse-numbers=false&"
@alexcwatt
alexcwatt / README.md
Last active November 28, 2021 23:08
VS Code: Language Specific Settings

This gist shows how to configure VS Code settings, including tab/space settings, by language / file extension.

Note: You can also configure "editor.insertSpaces": true/false on a per-language basis. I use "editor.insertSpaces": true at a global level, but I don't want to start another spaces vs. tabs war!

@alexcwatt
alexcwatt / destructuring_demo.js
Last active March 20, 2021 14:17
JavaScript destructuring example
// Solution to destructuring problem here: https://kentcdodds.com/blog/javascript-to-know-for-react
const info = {
title: 'Once Upon a Time',
protagonist: {
name: 'Emma Swan',
enemies: [
{name: 'Regina Mills', title: 'Evil Queen'},
{name: 'Cora Mills', title: 'Queen of Hearts'},
{name: 'Peter Pan', title: `The boy who wouldn't grow up`},
@alexcwatt
alexcwatt / Pipfile
Last active March 12, 2019 01:53
pipenv sync debug
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
Cerberus = "==1.2"
"PyQt5" = "==5.10"
pip = "==18.0"
pandas = "==0.23.4"
@alexcwatt
alexcwatt / heroku_log
Created May 27, 2014 22:45
Troubleshooting 404 error with /records/3261
# For http://stackoverflow.com/questions/23899959/rails-404-error-for-html-format-but-no-issue-with-json-format
2014-05-27T22:11:26.522287+00:00 heroku[router]: at=info method=HEAD path=/ host=myapplication.herokuapp.com request_id=d5fca9c8-b0bc-43ee-96ed-8164540cb8f3 fwd="184.73.237.85" dyno=web.1 connect=1ms service=16ms status=301 bytes=187
2014-05-27T22:11:39.940294+00:00 heroku[router]: at=info method=HEAD path=/ host=myapplication.herokuapp.com request_id=30263b85-7c07-42eb-8391-9da0545c3e7e fwd="54.247.188.179" dyno=web.1 connect=1ms service=3ms status=301 bytes=187
2014-05-27T22:11:51.688512+00:00 heroku[router]: at=info method=HEAD path=/ host=myapplication.herokuapp.com request_id=80b3acf0-f00c-4397-912c-bd25e31f9ae2 fwd="54.248.250.232" dyno=web.1 connect=7ms service=17ms status=301 bytes=187
2014-05-27T22:11:52.141191+00:00 heroku[router]: at=info method=HEAD path=/ host=myapplication.herokuapp.com request_id=cf3e8d1a-df86-4085-b83b-99272bfa626f fwd="50.112.95.211" dyno=web.1 connect=4ms service=
@alexcwatt
alexcwatt / markercluster_multi-layer-markers.html
Last active December 16, 2015 09:19
Example of markers in multiple layers with Leaflet markercluster. Copied from a project using Twitter Bootstrap and jQuery.
<div id="map-buttons" class="btn-group" data-toggle="buttons-checkbox">
<button id="layer1" class="btn active">Layer 1</button>
<button id="layer2" class="btn active">Layer 2</button>
<button id="layer3" class="btn active">Layer 3</button>
</div>
<script type="text/javascript">
// Setup "layer" arrays
layer1Array = new Array();
layer2Array = new Array();