Skip to content

Instantly share code, notes, and snippets.

View beenotung's full-sized avatar

Beeno Tung beenotung

View GitHub Profile
@beenotung
beenotung / .bash_error
Created May 11, 2021 23:28
command not found handler for shell
command_not_found_handle() {
# Do not run within a pipe
if test ! -t 1; then
echo "command not found: $1" >&2
return 127
fi
# run local file if exist
if [ -f "$1" ]; then
echo "running ./$1..." >&2
@beenotung
beenotung / hackers-news.users.js
Last active May 2, 2020 22:05
user script to improve readability and night mode for hackers news
// ==UserScript==
// @name hackers-news
// @namespace http://tampermonkey.net/
// @version 0.1
// @description improve readability and night mode for hackers news
// @author You
// @match https://news.ycombinator.com/item?id=*
// @match https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
#!/bin/bash
## extract files archived from git-compress
## TODO use tmp folder to support operation within a git repo
set -e
set -o pipefail
with_progress=0
filename=''
if [ "$1" == "-p" ] || [ "$1" == "--progress" ]; then
#!/bin/bash
## use git to compress a single folder or file
## TODO use tmp folder to support operation within a git repo
set -e
set -o pipefail
with_progress=0
filename=''
dest=''
@beenotung
beenotung / mobile-index.html
Last active July 15, 2019 05:02
html meta for mobile friendly
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
</head>
<body>
@beenotung
beenotung / transfer.fish
Last active March 4, 2019 07:22 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\ntransfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@beenotung
beenotung / progress-demo.js
Created February 18, 2019 05:51
demo of npm package progress for cli progress bar
var ProgressBar = require('progress');
var bar = new ProgressBar(' demo-ing progress [:bar] :percent :etas',{
complete: '=',
incomplete: ' ',
width: 20,
total: 100,
});
var timer = setInterval(()=>{
if(bar.curr<bar.total) {
bar.tick(1);
@beenotung
beenotung / redlink-join.ts
Last active May 24, 2018 00:36
Illustration of tentative RedLink lucky draw algorithm
@beenotung
beenotung / ai-repos.asciidoc
Created December 24, 2017 19:48
A resource reference sheet about AI to new comer

List of resources about AI

For beginner

Artificial Intelligence library written in Golang

  • Neural Network

    1. Back Propagation

Keybase proof

I hereby claim:

  • I am beenotung on github.
  • I am beenotung (https://keybase.io/beenotung) on keybase.
  • I have a public key ASCuGEFXtQCZuqwFt8qhtCY2l7-CjpU5M84qt8hFc7wsqQo

To claim this, I am signing this object: