Skip to content

Instantly share code, notes, and snippets.

Alex Chan alexanderchan

Block or report user

Report or block alexanderchan

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
alexanderchan / package.json
Created Jan 18, 2019 — forked from adamreisnz/package.json
Simple pure npm scripts build process
View package.json
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "",
"author": {
"name": "Adam Buczynski",
"url": ""
"license": "UNLICENSED",
alexanderchan /
Created Dec 10, 2018 — forked from bastman/
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:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
alexanderchan / openselectioninatom
Created Jan 12, 2017
write a file and open the contents in atom
View openselectioninatom
function run(input, parameters) {
var str = $.NSString.alloc.initWithUTF8String(input);
var jsonPath = Path('/tmp/test.json');
str.writeToFileAtomically(jsonPath.toString(), true);
var atom = Application('Atom')
alexanderchan /
Created Nov 1, 2016 — forked from robschmuecker/
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>JS Bin</title>
<script src=""></script>
alexanderchan /
Last active Mar 4, 2016 — forked from herrstucki/
Transitions with React and D3 I
View testautosize.js
/*jshint esnext:true */
class TestAutosize extends React.Component {
this.state = {
searchText: 'some example text'
this.autosize = this.autosize.bind(this);
View chart.html
<div id="chart">
<h4>Percent of adults over 25 with at least a bachelor's degree:</h4>
<p><strong>Median:</strong> <span class="median"></span></p>
<small>Source: <cite><a href="">U.S. Census Bureau</a></cite>, via <cite><a href="">Census Reporter</a></cite></small>
View index.html
<div ng-app="sortableApp" ng-controller="sortableController" class="container">
<h2>ui.sortable connected lists event order</h2>
<div class="floatleft">
<div ui-sortable="sortableOptionsList[0]" class="apps-container screen floatleft" ng-model="rawScreens[0]">
<div class="app" ng-repeat="app in rawScreens[0]">{{$index}} {{app.title}}</div>
<div ui-sortable="sortableOptionsList[1]" class="apps-container screen floatleft" ng-model="rawScreens[1]">
<div class="app" ng-repeat="app in rawScreens[1]">{{$index}} {{app.title}}</div>
You can’t perform that action at this time.