Skip to content

Instantly share code, notes, and snippets.

Working from home

Lishi He ikbear

Working from home
Block or report user

Report or block ikbear

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ikbear /
Created Dec 31, 2015 — forked from kachayev/
Channels Are Not Enough or Why Pipelining Is Not That Easy
ikbear /
Created Nov 18, 2015 — forked from ngpestelos/
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
ikbear /
Last active Jul 8, 2019
Docker image entrypoint idle script
echo "This is a idle script (infinite loop) to keep container running."
echo "Please replace this script."
cleanup ()
kill -s SIGTERM $!
exit 0
ikbear /
Created Oct 20, 2015
Docker cleanup script
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
ikbear / gist:bcfc3b814f0e70bcc436
Created Oct 1, 2015 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan Developer Preview 2
View gist:bcfc3b814f0e70bcc436

OS X Preferences

most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
-------- start loop --------
2015/09/30 15:27:36.745404 [D][SCD][#1443598056][C_0][""] active!
2015/09/30 15:27:36.746252 [D][SCD][#1443598056][C_0][""] loadNodesMeta Normal 1 | ReservedNormal 0
2015/09/30 15:27:36.746267 [D][SCD][#1443598056][C_0][""] loadNodesMeta Offline 0 | ForcedOffline 0
2015/09/30 15:27:36.746274 [D][SCD][#1443598056][C_0][""] loadNodesMeta Clear 0
2015/09/30 15:27:36.746797 [D][SCD][#1443598056][][""] Real <cpu> 0.091 core / 1.000 core = 0.09 <mem> 466.8 MB / 1.956 GB = 0.23 <ls> 16 <bs> 14
2015/09/30 15:27:36.751137 [D][SCD][#1443598056][C_0][""] check the 0 of 1 pod(s) from app 10000
2015/09/30 15:27:36.751338 [D][SCD][#1443598056][C_0][""] loadDirtyPods dirty pods(all): 1
2015/09/30 15
ikbear / gist:14e8efe091e9ed33ecc0
Created Sep 22, 2015 — forked from paulirish/gist:4158604
Learn JavaScript concepts with recent DevTools features
View gist:14e8efe091e9ed33ecc0

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.


Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

ikbear /
Created Sep 22, 2015 — forked from paulirish/
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
You can’t perform that action at this time.