Skip to content

Instantly share code, notes, and snippets.

View louiscklaw's full-sized avatar
😀
life finds a way ... LEARN !!!

Louis Law, louiscklaw louiscklaw

😀
life finds a way ... LEARN !!!
View GitHub Profile
@louiscklaw
louiscklaw / get_gitignore
Last active June 12, 2020 07:50
getting gitignore template from command line
# paste it in .zshrc bottom
get_gitignore () {
# get_gitignore python
# get_gitignore node
# get_gitignore java
TEST=$1
# echo ${TEST:0:1} | tr [:lower:] [:upper:]
LEFT_MOST=`echo ${TEST:0:1} | tr '[:lower:]' '[:upper:]'`
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install my-weather-indicator
sudo apt-get install filezilla
sudo apt-get install neofetch
sudo apt install kicad
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install my-weather-indicator
ubuntu python3-pip problem and solver
error message:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
To solve:
#!/usr/bin/python3
#!/bin/bash -e
# origional link: https://chrisdown.name/2015/09/27/auto-merging-successful-builds-from-travis-ci.html
# BRANCH_TO_MERGE_REGEX is a regex that the current branch should match if a merge will take place. In my case, I limit it to feature branches (marked with f/), as there might be other branches I want to stick around without merging.
# BRANCH_TO_MERGE_INTO is the branch to merge into as part of deployment. I use two branches; master, which contains the latest stable code, and deploy, which contains the development code. In my case, I merge into deploy on successful build.
# GITHUB_REPO is the repo path that is being pushed to. For example, cdown/srt in this case.
# The script also needs GITHUB_SECRET_TOKEN, but that will be provided by the secret we generated above.
about-scheme
chrome-extension-scheme
chrome-scheme
moz-extension-scheme
opera-scheme
vivaldi-scheme
wyciwyg-scheme
127.0.0.1
alipay.com
aliwangwang.com
alert("hello_gist_body");
// Source: https://github.com/muan/emojilib (simplemap.json)
var EMOJI = {
"100": "💯",
"1234": "🔢",
"grinning": "😀",
"grimacing": "😬",
"grin": "😁",
"joy": "😂",
"smiley": "😃",
#!/usr/bin/env sh
# sh <(curl https://gist.githubusercontent.com/louiscklaw/80717b71ac09ea6d53204dfcc4da1eac/raw/80b4256737234b7598802e10115b8a848ad574e4/helloworld.sh -L -s) test
echo "$*"
# RTHK31
rthk31 () {
link=$(curl -s -L https://www.rthk.hk/feeds/dtt/rthktv31_https.m3u8 | python2 -c 'import sys; list=sys.stdin.readlines(); print list[list.index("#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2180000,RESOLUTION=1280x720,CODECS=\"avc1.66.30, mp4a.40.2\""\n")+1]') && mpv $link &
}
# RTHK32
rthk32 () {
link=$(curl -s -L https://www.rthk.hk/feeds/dtt/rthktv31_https.m3u8 | python2 -c 'import sys; list=sys.stdin.readlines(); print list[list.index("#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2148000,RESOLUTION=1280x720,CODECS=\"avc1.66.30, mp4a.40.2\"\n")+1]') && mpv $link &
}