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
def split(str, delimiters) | |
delimiters = delimiters.split(//) | |
result, acc = [], "" | |
str.split(//).each do |c| | |
if delimiters.include?(c) | |
# add the acculumator and the delimiter to our growing output array | |
unless acc.empty? | |
result << acc | |
acc = "" # reset accumulator |
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
void loop() { | |
ABWindow *window; | |
bool focused; | |
// pause render until it's time for the next frame | |
if (!(arduboy.nextFrame())) | |
return; | |
arduboy.clear(); |
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
#define PROMPT(buffer, direction, index, result) \ | |
do { \ | |
char *after; \ | |
char before[MAX_LINE_LEN]; \ | |
fprintf(stderr, "(search %c%d) `%s':", direction[0], index, buffer); \ | |
if (index > 0) {\ | |
int i = 0; \ | |
after = strstr(result,buffer); \ | |
int len = strlen(result) - strlen(after); \ | |
strcpy(before, result); \ |
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
Homebrew build logs for rust on macOS 10.13.1 | |
Build date: 2017-11-01 11:59:19 |
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
### Keybase proof | |
I hereby claim: | |
* I am yyyc514 on github. | |
* I am yyyc514 (https://keybase.io/yyyc514) on keybase. | |
* I have a public key ASCLrWqr7nJF5ud8-nPRzMc19-VgSlvOtj-Vg3-3gLxPzgo | |
To claim this, I am signing this object: |
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
// should really use various NOPs here instead of while loop | |
#define SPOUT(x) SPDR = x; \ | |
while (!(SPSR & _BV(SPIF))) { } | |
// should really use various NOPs here instead of while loop | |
#define SPOUT2(x) SPDR = x; \ | |
while (!(SPSR & _BV(SPIF))) { } | |
// should really use various NOPs here instead of while loop | |
#define SPOUT3(x) SPDR = x; \ |
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
template render*(body: string) :untyped = | |
if (resp.code == 0): | |
resp.code = 200 | |
resp.body = body | |
### How do I write this without changing resp.body? body in the template is wrongly taking it's place also. |
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
location @missing { | |
# how can i always log this? | |
return 404; | |
} | |
location ~* \.(jpg|jpeg|gif|css|js)$ { | |
access_log off; | |
expires 30d; | |
rewrite_log on; |
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/log/nginx/access.log <== | |
96.28.189.235 - - [25/Apr/2020:23:36:50 +0000] "GET /pastes.atom HTTP/1.1" 410 136 "-" "curl/7.54.0" | |
79.209.49.117 - - [25/Apr/2020:23:36:51 +0000] "GET /pastes.atom HTTP/1.1" 301 162 "-" "Mozilla/5.0 (X11; |
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
body { | |
background:black; | |
color: #ccc; | |
padding:0px 40px; | |
font-family: "Operator Mono"; | |
font-weight: 200; | |
} | |
h1,h2,h3,p { | |
font-size:1em; |