Skip to content

Instantly share code, notes, and snippets.

@hruan
hruan / .testcontainers.properties
Last active December 15, 2022 16:46
Running Test Containers on remote machine
# Replace $HOST with dockerd hostname
# Replace $HOME with absolute path to $HOME
client.ping.timeout=60
docker.client.strategy=org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
docker.host=tcp\://$HOST\:$2376
docker.cert.path=$HOME/.docker/certs/$HOST
docker.tls.verify=1
@hruan
hruan / README.md
Created August 5, 2022 08:15
Fix Microsoft Sculpt key mappings for macOS

On the Nordic version of Microsoft Sculpt keyboard gets § and < keys are swapped for unknown reasons. To correct this, save file below as $HOME/Library/LaunchAgents/local.hidutilKeyMapping.plist and run

launchctl load $HOME/Library/LaunchAgents/local.hidutilKeyMapping.plist
launchctl start local.hidutilKeyMapping

For details see:

@hruan
hruan / Keybase.md
Created March 27, 2019 21:26
keybase.md

Keybase proof

I hereby claim:

  • I am hruan on github.
  • I am hruan (https://keybase.io/hruan) on keybase.
  • I have a public key ASBa-efICtxqMOvd-_PLzRd9WuDVHKRIzoiTMfl3W0aDrgo

To claim this, I am signing this object:

@hruan
hruan / gist:f002c145072692f5a496
Created February 8, 2016 10:21
JavaScript WTF
function getArgs() {
return arguments;
}
// Node REPL
> const args = getArgs(1, 2, 3)
undefined
> args
{ '0': 1, '1': 2, '2': 3 }
> const argsLiteral = { '0': 1, '1': 2, '2': 3 }
@hruan
hruan / gist:1d394c08907b5f89029a
Created February 16, 2015 08:31
HttpPlatformHandler Web.config for Go
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%HOME%\site\wwwroot\go-azure.bat"
arguments="-port %HTTP_PLATFORM_PORT% %HOME%\site\wwwroot\_target"
startupRetryCount="3"
stdoutLogEnabled="true" />
@hruan
hruan / gen_country_table.py
Created September 26, 2012 08:00
Generate table with country names according to ISO 3361-1
import xml.etree.ElementTree as ET
import requests
import functools
config = dict(
url = "http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_xml.htm",
entry_tag = "ISO_3166-1_Entry",
country_tag = "ISO_3166-1_Country_name",
country_code = "ISO_3166-1_Alpha-2_Code_element",
table_name = "country",