Skip to content

Instantly share code, notes, and snippets.

View SuperCipher's full-sized avatar
💭
GMT+7 08:00 - 22:00

Napat SuperCipher

💭
GMT+7 08:00 - 22:00
  • BiggestFan Production
  • Thailand
View GitHub Profile
@SuperCipher
SuperCipher / bu_make_j2_error_log.txt
Created September 11, 2021 09:44
bu "make -j2" build error
docker build . ⮂
[+] Building 509.3s (14/15)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 932B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:18.04
@SuperCipher
SuperCipher / postgres-cheatsheet.md
Created September 9, 2021 13:44 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@SuperCipher
SuperCipher / gist:572214debd8bea53b54f7b6cd0857d75
Created July 31, 2021 09:11
Best way to deal with piece of shit google HTTP Referer API restriction
https://stackoverflow.com/a/50146434/3422861
@SuperCipher
SuperCipher / flushDnsCache.sh
Created July 21, 2021 07:01
Flush DNS Cache mac
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
@SuperCipher
SuperCipher / shell.nix
Last active July 6, 2021 12:24
nix-shell import remote shell config
nix-shell -I variableFoo=https://github.com/edolstra/flake-compat/archive/master.tar.gz -E "import <variableFoo>"
nix-shell -E 'import (builtins.fetchurl "https://raw.githubusercontent.com/workflow/nix-shell-action/main/shell.nix") {}'
@SuperCipher
SuperCipher / nix-resource.txt
Last active June 18, 2021 13:30
nix resource
Nix language Fundamentals
https://www.youtube.com/watch?v=m4sv2M9jRLg
@SuperCipher
SuperCipher / ElmTimeTicket.elm
Created June 2, 2021 09:47
Elm Time Ticket
import Time
subscriptions : ModelsElmArchitect.State -> Sub Msg
subscriptions _ =
Time.every (5 * 1000) (\_ -> ModelsElmArchitect.Reload)
@SuperCipher
SuperCipher / self-execute.js
Created May 31, 2021 08:15
self execute JS
(async () => {
try {
// console.log('resp', resp)
} catch (e) {
console.error(e);
}
})();
@SuperCipher
SuperCipher / fetch.js
Created March 30, 2021 12:07
fetch real life example
function requestBid(eventID,requestSlpAddress) {
const url = AUCTION_BACKEND_URL;
const data = {
eventID: eventID,
bidderAddress: requestSlpAddress
};
const jsonData = JSON.stringify(data);
const params = {
@SuperCipher
SuperCipher / filterArrayWithArray.elm
Created March 24, 2021 11:38
filter array with array in elm / functional language
filterProduct : Product.ProductModelList -> Product.ProductModelList
filterProduct productModelList =
List.filter (\x -> List.member x.id ["products-id-uu01","products-id-uu02"]) productModelList