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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"time" | |
"github.com/cockroachdb/cockroach/client" | |
"github.com/cockroachdb/cockroach/proto" | |
) |
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
class Typed<T> { | |
type: T | |
constructor(obj: T) { | |
this.type = obj; | |
} | |
} | |
interface MyType { | |
prop: string; |
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 text_colors = AnyDict( | |
:black => "\033[1m\033[30m", | |
:red => "\033[1m\033[31m", | |
:green => "\033[1m\033[32m", | |
:yellow => "\033[1m\033[33m", | |
:blue => "\033[1m\033[34m", | |
:magenta => "\033[1m\033[35m", | |
:cyan => "\033[1m\033[36m", | |
:white => "\033[1m\033[37m", | |
:normal => "\033[0m", |
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
macro stringall(msg...) | |
return :(join(map((i) -> string(eval(i)), $msg), " ")) | |
end | |
x = "foo" | |
function test() | |
x = "bar" | |
global y = "baz" | |
@stringall x y |
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 | |
# I keep Julia binaries in /opt/julia with the same directory structure | |
# as ~/.julia to store different versions, and use this script to switch | |
# between them. I also like to maintain a link of the ~/.julia folder to | |
# ~/julia, for easier package development. | |
JBIN="" | |
PDIR="" |
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
using HTTPClient: HTTPC | |
using JSON | |
# Fill in your city name and GitHub API token | |
const MEETUP_LOCATION = lowercase("Seattle") | |
const API_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
# Pages of search results to examine. Warning - you WILL hit the rate limit | |
const NUM_PAGES = 1 | |
typealias Field Union{AbstractString,Void} |
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 | |
BANK_DIR=$HOME/.bank | |
mkdir -p $BANK_DIR; | |
if [ "$1" = "lock" ]; then | |
if [ -e $BANK_DIR.tar.gz.gpg ]; then | |
echo "$BANK_DIR already locked."; | |
exit 1; |
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
package main | |
import ( | |
"bufio" | |
"errors" | |
"flag" | |
"fmt" | |
"os" | |
"path/filepath" | |
"strings" |
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
function touch() { | |
<# | |
.SYNOPSIS | |
An analog to the UNIX 'touch' command | |
.DESCRIPTION | |
This approximates common usage of the UNIX 'touch' command. If the target | |
file does not exist, it is created as a regular file. If it does exist, the | |
last access time is set to the current time. | |
.PARAMETER fname | |
The target file path |
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
class XBlink extends HTMLElement { | |
constructor() { | |
super(); | |
this.attachShadow({ mode: 'open' }) | |
.appendChild(document.createElement('slot')); | |
} | |
connectedCallback() { | |
this.speed = parseInt(this.getAttribute('speed') || '500'); |