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
process.on('beforeExit', async () => { | |
const res = await fetch('https://copilot-proxy.githubusercontent.com/_ping'); | |
console.log('beforeExit', res.status, await res.text()); | |
}); | |
process.on('SIGINT', () => { | |
console.log('SIGINT'); | |
process.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
/**************************************************************************/ | |
/*! | |
This is a demo for the Adafruit MCP9808 breakout | |
----> http://www.adafruit.com/products/1782 | |
Adafruit invests time and resources providing this open source code, | |
please support Adafruit and open-source hardware by purchasing | |
products from Adafruit! | |
*/ | |
/**************************************************************************/ |
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
{ | |
"telemetry.enableTelemetry": false, | |
"editor.tabSize": 2, | |
"editor.lineNumbers": "relative", | |
"workbench.colorTheme": "Solarized Dark", | |
"[javascriptreact]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"vim.leader": " ", | |
"[javascript]": { |
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" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func 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
package main | |
import "fmt" | |
func main() { | |
a := []int{1, 2, 3, 3, 2, 4, 2} | |
fmt.Printf("Local max of %v are %v\n", a, localMax(a)) | |
} | |
func localMax(a []int) []int { |
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" | |
func main() { | |
var board = [][]byte{ | |
[]byte{'A', 'B', 'C', 'E'}, | |
[]byte{'S', 'F', 'C', 'S'}, | |
[]byte{'A', 'D', 'E', 'E'}, | |
} |
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" | |
"strings" | |
) | |
func main() { | |
p := [][]int{ | |
[]int{17, -45}, |
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" | |
func main() { | |
a := createListNodes([]int{2, 3, 4, 0, 2, 8, 9}) | |
fmt.Println("starting with", a) | |
fmt.Println("ending with", sortList(a)) | |
} |
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 | |
host='remote' | |
path='/remote/path/to/dir' | |
while ! rsync --append-verify -Prz $host:$path . | |
do | |
sleep 1 | |
done |
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 | |
for f in *.jpg | |
do | |
num=${f//[^0-9]/} | |
secs=${num:0:4} | |
mmss=$(printf '%02d%02d\n' $((10#$secs/60)) $((10#$secs%60))) | |
touch -mt 20180528${mmss} $f | |
touch -t 20180528${mmss} $f | |
done |
NewerOlder