This file contains hidden or 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 | |
# Back ups every file that gets touched by `nano`. | |
# Install by: | |
# 1. `sudo mv /bin/nano /bin/nano-real` | |
# 2. Put this file in `/usr/local/bin` and make it executable. | |
# 3. Set your user: | |
backupFolder=$HOME/.system-changes | |
currentFolder=$(pwd) |
This file contains hidden or 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
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) | |
export PATH="$PATH:`yarn global bin`" | |
export MOSH_TITLE_NOPREFIX=1 | |
export GOROOT=/usr/local/go | |
export GOPATH=$HOME/go | |
export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH | |
export PATH=$PATH:~/.cargo/bin |
This file contains hidden or 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
<!doctype html> | |
<title>My website</title> | |
<!-- Validate your own here: https://validator.w3.org/ --> | |
<main> | |
<h1>My website</h1> | |
<p>Some texts.</p> | |
</main> |
This file contains hidden or 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 | |
wake-computer | |
echo 🚀 Connecting Mosh. | |
mosh [email protected] |
This file contains hidden or 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
// https://github.com/cjdelisle/cjdns/blob/77259a49e5bc7ca7bc6dca5bd423e02be563bdc5/doc/proxying.md | |
function FindProxyForURL(url, host) { | |
// If we can't resolve this means that this host is IPv4 only. Trying cjdns won't hurt. | |
// It also make IPv4 only hosts connect ot clearnet IPv6 hosts if proxy is IPv6 capable. | |
// If we can resolve check if the host is insice cjdns network space. | |
if (shExpMatch(host, "fc*:*") || !dnsResolve(host) || shExpMatch(dnsResolve(host), "fc*:*")) { | |
return "SOCKS5 localhost:8080"; | |
} | |
return "DIRECT"; |
This file contains hidden or 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 | |
# Source: https://superuser.com/a/1030779 | |
# standard sshd config path | |
SSHD_CONFIG=/etc/ssh/sshd_config | |
# helper functions | |
function tablize { | |
awk '{printf("| %-7s | %-7s | %-47s |\n", $1, $2, $3)}' |
This file contains hidden or 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 choo = require('choo') | |
const app = choo() | |
app.model({ | |
state: { title: 'Set the title' }, | |
reducers: { | |
update: (action, state) => ({ title: action.value }) | |
}, | |
subscriptions: [ | |
(send) => setInterval(() => {send('print', { payload: 'dog?' })}, 1000) |
This file contains hidden or 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
var hyperlog = require('hyperlog') | |
var levelup = require('levelup') | |
var steed = require('steed') | |
var db1 = levelup('./db1', { db: require('memdown') }) | |
var db2 = levelup('./db2', { db: require('memdown') }) | |
var db3 = levelup('./db3', { db: require('memdown') }) | |
var log1 = hyperlog(db1) | |
var log2 = hyperlog(db2) |
This file contains hidden or 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
/* | |
A proper divisor of a positive integer n is any divisor | |
of n other than n itself. | |
A number n is called deficient if the sum of its proper | |
divisors is less than n and it is called abundant if | |
this sum exceeds n. | |
As 12 is the smallest abundant number, | |
1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be |
This file contains hidden or 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
SetEnvIf Request_URI "^(.*)" PORT=65300 | |
RewriteEngine On | |
RewriteBase / | |
# CORS | |
Header add Access-Control-Allow-Origin "*" | |
# HTTPS | |
RewriteCond %{HTTPS} !=on |