- https://saml.github.io
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
.PHONY: clean all test | |
VERSION ?= $(shell git describe --tags --abbrev=0) | |
REVISION ?= $(shell git rev-parse HEAD) | |
BUILDDATE ?= $(shell date) | |
IMPORTNAME = github.com/saml/yolo | |
all: bin/yolo bin/yolo-webap | |
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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"html/template" | |
) | |
type WebPage struct { |
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
//http://play.golang.org/p/eM_xC8Tw5r | |
package main | |
import ( | |
"fmt" | |
) | |
type Resource interface { | |
ID() string | |
} |
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
sqlite> create table things(user text, girl text, action text, date datetime); | |
sqlite> insert into things values ('saml', 'jessica alba', 'married', datetime('now')); | |
sqlite> insert into things values ('saml', 'jessica alba', 'divorced', datetime('now')); | |
sqlite> insert into things values ('saml', 'sigourney weaver', 'married', datetime('now')); | |
sqlite> insert into things values ('saml', 'sigourney weaver', 'divorced', datetime('now')); | |
sqlite> insert into things values ('saml', 'jessica alba', 'married', datetime('now')); | |
sqlite> select user,girl,action,max(date) from things where user = 'saml' group by girl; | |
saml|jessica alba|married|2016-04-06 21:24:09 | |
saml|sigourney weaver|divorced|2016-04-06 21:24:02 |
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 | |
version="${VERSION:-$(git describe --tags --abbrev=0)}" | |
revision="${REVISION:-$(git rev-parse HEAD)}" | |
builddate="$(date)" | |
wgo restore && | |
wgo test ./ && | |
wgo build -ldflags "-X \"main.appVersion=$version\" -X \"main.appRevision=$revision\" -X \"main.appBuildDate=$builddate\"" |
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
open("/home/saml/.config/Code/storage.json", O_RDONLY|O_CLOEXEC) = 62 | |
fstat(62, 0x7ffe124d6580) = 0 | |
read(62, "{...content of storage.json...}", 3135) = 3135 | |
close(62) = 0 | |
madvise(0xdd418172000, 36864, MADV_DONTNEED) = 0 | |
madvise(0xdd41860b000, 2297856, MADV_DONTNEED) = 0 | |
madvise(0xdd4182ef000, 69632, MADV_DONTNEED) = 0 | |
madvise(0xdd418172000, 36864, MADV_DONTNEED) = 0 | |
madvise(0xdd418172000, 36864, MADV_DONTNEED) = 0 | |
madvise(0xdd418172000, 36864, MADV_DONTNEED) = 0 |
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
class One: | |
def __next__(self) -> int: | |
return 1 | |
class OneStr: | |
def __init__(self) -> None: | |
self.iterable = One() | |
def __next__(self) -> str: | |
return str(next(self.iterable)) |
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
# TERM first, then KILL if not dead | |
kill -TERM $pid >/dev/null 2>&1 | |
usleep 100000 | |
if checkpid $pid && sleep 1 && | |
checkpid $pid && sleep $delay && | |
checkpid $pid ; then | |
kill -KILL $pid >/dev/null 2>&1 | |
usleep 100000 | |
fi |
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
E A D A/C# E | |
Oh baby I'm so lonely. Waking up in the morning alone. | |
F#m E D A/C# D A/C# Bm | |
The sun hasn't even come up. Oh I'm getting old, losing morning sleep. | |
D E A D A/C# E | |
And I sleep before 10. Oh baby I'm so lonely. Belting out at night alone. | |
F#m E D A/C# D A/C# Bm | |
The sun is already down. Oh I'm getting old, losing all my voice | |
D E G A | |
on a song less than a minute. |
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
#包含 <基本.头文件> | |
定數 主(空虛) { | |
出力("你好世上"); | |
返還 空; | |
} | |