Skip to content

Instantly share code, notes, and snippets.

View tk3369's full-sized avatar
🐶
Published! Hands on design patterns and best practices with Julia.

Tom Kwong tk3369

🐶
Published! Hands on design patterns and best practices with Julia.
View GitHub Profile
function getMaxEatenDiscountCount_foreach(N, D, K) {
let eaten = new Set();
let eatSum = 0;
let eatCounter = 0;
D.forEach((dish) => {
if (!eaten.has(dish)) {
eatSum++;
eaten.add(dish);
eatCounter++;
}
function getMaxEatenDiscountCount_foreach(N, D, K) {
let eaten = new Set();
let eatSum = 0;
let eatCounter = 0;
D.forEach((dish) => {
if (!eaten.has(dish)) {
eatSum++;
eaten.add(dish);
eatCounter++;
}
function getMaxEatenDiscountCount_foreach(N, D, K) {
let eaten = new Set();
let eatSum = 0;
let eatCounter = 0;
D.forEach((dish) => {
if (!eaten.has(dish)) {
eatSum++;
eaten.add(dish);
eatCounter++;
}
@tk3369
tk3369 / gist:6591d09009938ae9c039362ec345a526
Last active September 3, 2021 18:26
mami-shop dev setup

Try yarn build:

➜  small-shopping-cart git:(master) yarn build
yarn run v1.22.11
$ react-scripts build
/bin/sh: react-scripts: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@tk3369
tk3369 / gist:871af7f4a29a8edafa858d51494e515a
Created July 24, 2021 05:17
hojbot(hoj) crash 2021-07-24T05:12:41.651 UTC
┌ Info: Reconnecting
│ time = 2021-07-24T05:12:23.746
│ conn = 5
│ resume = true
└ zombie = true
┌ Error: Getting gateway URL failed
│ time = 2021-07-24T05:12:41.651
│ exception =
│ DNSError: discordapp.com, temporary failure (EAI_AGAIN)
│ Stacktrace:
@tk3369
tk3369 / gist:ef17732a3ff3a233f1e16f904b374f46
Created July 24, 2021 05:16
hojbot(juliacon) crash 2021-07-24T05:12:22.270 UTC
┌ Info: Reconnecting
│ time = 2021-07-24T05:12:12.487
│ conn = 25
│ resume = true
└ zombie = true
┌ Error: Getting gateway URL failed
│ time = 2021-07-24T05:12:22.270
│ exception =
│ DNSError: discordapp.com, temporary failure (EAI_AGAIN)
│ Stacktrace:
# Installation issue
```
Precompiling project...
✗ SimpleDirectMediaLayer
8 dependencies successfully precompiled in 19 seconds (53 already precompiled)
1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
julia> using Pkg
@tk3369
tk3369 / tictactoe.txt
Last active July 10, 2021 08:20
tic-tac-toe game
TicTacToe game
> ttt start
@tk3369, ok - let's play a Tic-Tac-Toe game!
Enter your move as letter-digit. For example, `ttt b3`.
a b c
|---|---|---|
1 | | | |
|---|---|---|
2 | | | |
@tk3369
tk3369 / tz.txt
Created July 10, 2021 08:05
hojbot tz command
Improve tz command
- "tz me <my-time-zone>" command to configure per-user time zone
- "tz alias add <alias> <zone-name>" command to add system aliases
- "tz alias rm <alias>" command to remove system aliases
- target time zone command "tz <date> <time> <zone1> to <zone2>,<zone3>,..."
(without zone2+, it converts to user's own time zone, or direct user to use tz me command)
Reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Examples: