Skip to content

Instantly share code, notes, and snippets.

View owlfox's full-sized avatar
🏠
Working from home

Chen Zeren owlfox

🏠
Working from home
View GitHub Profile
@owlfox
owlfox / docker-cleanup-resources.md
Created October 20, 2019 02:30 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@owlfox
owlfox / Install CJK fonts to reMarkable Tablet.md
Created October 14, 2019 09:24 — forked from chenhunghan/Install CJK fonts to reMarkable Tablet.md
How to install Noto Sans CJK fonts for reMarkable Tablet

reMarkable is a paper tablet by https://remarkable.com/.

The reMarkable tablet is the best e-paper in the market. However, it does not have built-in support for CJK (Chiniese, Korean and Japanese) users.

Luckily, this could be resolved by installing CJK fonts on the tablet.

  1. Go to Preference > Storage > Enable USB web interface (Beta).
  2. Connect reMarkable with your PC via a microUSB cable.
  3. SSH to the device as user "root" using the password find in Preference > About. e.g. ssh root@10.11.99.1
  4. Download "NotoSansCJK[you language]-Regular.otf" from *note, there is limited space on the device, so do not sue "Super OpenType/CFF Collection (Super OTC)", an language-specific OTC is ok.
@owlfox
owlfox / index.html
Last active October 8, 2019 04:34
Taiwan map of towns v1
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Taiwan</title>
<style>
.boundary {
fill: none;
stroke: #888;
stroke-linejoin: round;
@owlfox
owlfox / index.html
Last active October 7, 2019 03:13
selection illustration diagram from d3 for the impatient
<div>
1.
<svg id="bind1" width="650" height="190" style="background: lightgrey">
<g transform="translate(150,0)">
<g transform="translate(50,0)">
<g transform="translate(10,10)">
<rect x="4" y="24" width="72" height="140" rx="30"
fill="rgb(179,230,255)" stroke="blue" />
<g fill="none" stroke="black">
@owlfox
owlfox / index.html
Last active October 7, 2019 06:19
example 3.1 of d3 for the impatient
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
<body>
<div>
<svg
id="key"
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mexico</title>
<style>
.boundary {
fill: none;
stroke: #888;
stroke-linejoin: round;

The Skills Poor Programmers Lack

A friend and I had a discussion about the basic skills that are often lacking in experienced programmers. How can a programmer work for ten or twenty years and never learn to write good code? So often they need close supervision to ensure they go down the right path, and they can never be trusted to take technical leadership on larger tasks. It seems they are just good enough to get by in their job, but they never become effective.

We thought about our experiences and came up with three fundamental skills that we find are most often missing. Note that these are not skills which take a considerable amount of talent or unique insight. Nor are they "trends" or "frameworks" to help you get a new job. They are basic fundamentals which are prerequisites to being a successful programmer.

Understand how the language works

Programmers cannot write good code unless they understand what they are typing. At the most basic level, this means they need to understand the rules of

@owlfox
owlfox / check_ntp.ps1
Created January 18, 2018 23:14
Check if ntp service running and try to start it in powershell, if failed prompt!
$sname="w32time"
#check if the service running
if((Get-service $sname | Where-Object {$_.status -eq "running"} ) -eq $Null){
#Not Running, restart it
Stop-service $sname
Start-service $sname
}
sleep 30
import java.nio.file.Files
import java.nio.file.Path
def getTempDirectory(prefix:String):String = {
val path = Files.createTempDirectory(prefix)
path.toString
}
@owlfox
owlfox / tmux-cheatsheet.markdown
Created March 30, 2017 02:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname