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
const getTimezoneName = () => { | |
try { | |
return Intl.DateTimeFormat().resolvedOptions().timeZone; | |
} catch (e) { | |
console.error('Failed to find the system timezone name.', e); | |
} | |
return null; | |
} |
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
wsl -d Ubuntu -u root ip addr del $(ip addr show eth0 ^| grep 'inet\b' ^| awk '{print $2}' ^| head -n 1) dev eth0 | |
wsl -d Ubuntu -u root ip addr add 192.168.50.2/24 broadcast 192.168.50.255 dev eth0 | |
wsl -d Ubuntu -u root ip route add 0.0.0.0/0 via 192.168.50.1 dev eth0 | |
wsl -d Ubuntu -u root echo nameserver 1.1.1.1 ^> /etc/resolv.conf | |
powershell -c "Get-NetAdapter 'vEthernet (WSL)' | Get-NetIPAddress | Remove-NetIPAddress -Confirm:$False; New-NetIPAddress -IPAddress 192.168.50.1 -PrefixLength 24 -InterfaceAlias 'vEthernet (WSL)'; Get-NetNat | ? Name -Eq WSLNat | Remove-NetNat -Confirm:$False; New-NetNat -Name WSLNat -InternalIPInterfaceAddressPrefix 192.168.50.0/24;" |
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/bash | |
# You must run this script from an "elevated terminal", that means right click on Windows Terminal and "Run as Administrator". | |
# Then run it with `sudo wsl-ip.sh` from within WSL. | |
# Remove existing wsl.local lines | |
sed -i '/wsl.local/d' /etc/hosts | |
sed -i '/wsl.local/d' /mnt/c/Windows/system32/drivers/etc/hosts | |
# Add to WSL hosts file |
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/bash | |
# Use this: | |
# export hostname=hello.world.com | |
# wget -O - https://gist.github.com/antriver/a38e8b18c3e491b5fd5caf1393a98ca4/raw | bash | |
# | |
# Use this script on a clean server to setup Puppet and then provision the server | |
# depending on its hostname. See instructions in README.md for usage. | |
# | |
# - Installs git (it already comes with 16.04 though!) |
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
<?php | |
// 'old-fa3-name' => 'new-fa4-name' | |
$icons = array( | |
'ban-circle' => 'ban', | |
'bar-chart' => 'bar-chart-o', | |
'beaker' => 'flask', | |
'bell' => 'bell-o', | |
'bell-alt' => 'bell', | |
'bitbucket-sign' => 'bitbucket-square', |
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
<?php | |
/** | |
* When user clicks the "yes, that's my email" link... | |
*/ | |
//Make a unique key | |
$key = uniqid(); | |
//Store in the database |
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
<?php | |
$curl_error_codes = array ( | |
0 => 'CURLE_OK', | |
1 => 'CURLE_UNSUPPORTED_PROTOCOL', | |
2 => 'CURLE_FAILED_INIT', | |
3 => 'CURLE_URL_MALFORMAT', | |
4 => 'CURLE_NOT_BUILT_IN', | |
5 => 'CURLE_COULDNT_RESOLVE_PROXY', | |
6 => 'CURLE_COULDNT_RESOLVE_HOST', | |
7 => 'CURLE_COULDNT_CONNECT', |