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 | |
set -xeuo pipefail | |
RELEASED_VERSION_TAG=${DD_VERSION:-7.50.3} | |
PRESERVE_WORKSPACE=${KEEP_BUID_WS:-yes} | |
BUILD_BUILDER=${NEED_BUILDER:-""} | |
# Create a workspace | |
WS=$(mktemp --tmpdir=. -d) |
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
#!/usr/bin/env perl | |
undef$/;$_=<DATA>;y/ODA\n / /ds; @yoda=map{length}split;print chr | |
oct join('',splice(@yoda,0,3))-111 while@yoda; | |
__DATA__ | |
DDOOODOOODOOODOOODOOODOOODOOODOOODOOODOOODOOODOOODOOODOOODOOODOOOOOD | |
D D | |
D 00O00O000O00O0000 000O DD000000O0 D | |
D 0DO0000000O0000O00 O00000 00O00000O0O D | |
D 0000 0O0 O00 O00 00D 0DO D | |
D 00O0 0O0 00D 000 DO0D00000D D |
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
// Live code - https://go.dev/play/p/EqW-c0gbRqr | |
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
func main() { |
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
// A toy 6502 CPU emulator (WIP). Inspired by a series of lessons by Ben Eater: | |
// - https://www.youtube.com/channel/UCS0N5baNlQWJCUrhCEo8WlA | |
// - https://youtu.be/LnzuMJLZRdU | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"os" |
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
// Go implementation for the "Functions and Fractals - Recursive Trees - Bash!" problem. | |
// https://www.hackerrank.com/challenges/fractal-trees-all/problem | |
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
const h = 15 // half-heigth of the Y pattern |
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
// This program provides an answer for one of the Google interview questions described here: | |
// https://www.businessinsider.com/answers-to-google-interview-questions-2011-11#you-need-to-check-that-your-friend-bob-has-your-correct-phone-number-10 | |
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func main() { |
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 disruptor | |
import ( | |
"encoding/binary" | |
"log" | |
"runtime" | |
"sync/atomic" | |
"time" | |
) |
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 ( | |
"fmt" | |
"log" | |
"strings" | |
) | |
func main() { | |
b := NewBank(map[Coin]int{ |
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
import ( | |
"io" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
) | |
// moveFile safely moves files across different file systems. | |
func moveFile(src, dest string) error { | |
// Fast path: use os.Rename(). |
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 ( | |
"fmt" | |
) | |
func main() { | |
for i := 0; i <= 45; i++ { | |
fmt.Printf("%3d %10d\n", i, memFib(i)) | |
} |
NewerOlder