Skip to content

Instantly share code, notes, and snippets.

View git-ashish's full-sized avatar
🏠
Freelancing – Open to exciting opportunities

Ashish Singh git-ashish

🏠
Freelancing – Open to exciting opportunities
View GitHub Profile

Created by Christopher Manning

Summary

Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.

Controls

@git-ashish
git-ashish / rebase
Last active August 29, 2015 14:06
Git - keep a feature branch updated
git checkout parent-branch
git pull --rebase upstream parent-branch
git checkout feature-branch
git rebase parent-branch
@git-ashish
git-ashish / getordinal.js
Created September 10, 2014 10:39
Number - Cardinal to Ordinal
function getOrdinal(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
@git-ashish
git-ashish / graph.json
Last active August 29, 2015 14:06 — forked from mbostock/.block
Force-Directed Tree Layout
{
"nodes": [
{"name": "d3"},
{"name": "d3.svg"},
{"name": "d3.svg.area"},
{"name": "d3.svg.line"},
{"name": "d3.scale"},
{"name": "d3.scale.linear"},
{"name": "d3.scale.ordinal"}
],
@git-ashish
git-ashish / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block
@git-ashish
git-ashish / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block

This example demonstrates how to animate a path and a textPath at the same time. I wouldn’t use this technique—the text is scrunched up at the beginning of the arc at the beginning of the animation. Instead, I would use the arc to clip the text, so that the text is revealed as the arc expands.

This example also demonstrates two unfortunate bugs in WebKit browsers:

  • You can’t select textPath elements because of a bug in how WebKit handles case-sensitive element names. See bug 83438. WebKit shows no sign of fixing this bug, unfortunately.

  • Updating a path element by itself does not trigger redraw on dependent elements that reference this path. So, even though we update the path, the referencing textPath element will not be redrawn. To workaround this update bug, we create a custom transition that repeatedly sets the textPath’s xlink:href attribute to “#path”.

See [related Stack Overflow question](http://stackoverflow.com/questi

@git-ashish
git-ashish / upgrade-php-ami
Created September 25, 2014 15:22
Upgrade php-* to php55 - Linux AMI
1. Get a list of php packages currently installed
``rpm -qa | grep php > packages.txt``
2. yum remove php-common - This will depend on the current php version. For >= 5.4, it would be yum remove php54-common
3. yum remove httpd httpd-tools
4. yum install php55 php55-mysqlnd php55-gd php55-mbstring
@git-ashish
git-ashish / ssh-tunnel.txt
Created September 27, 2014 18:46
Setup SSH Tunnel
# set up tunnel
ssh -L localhost:3316:localhost:3316 -i /path/to/private-key user@host
# Check if the tunnel is established
netstat -lnp | grep ssh | grep :3316
@git-ashish
git-ashish / README.md
Last active August 29, 2015 14:07 — forked from rkirsling/LICENSE

Click in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.

When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.

To see this example as part of a larger project, check out Modal Logic Playground!

@git-ashish
git-ashish / graph.json
Last active August 29, 2015 14:09 — forked from mbostock/.block
Bottom to Top Force Tree layout
{
"nodes": [
{"name": "d3"},
{"name": "d3.svg"},
{"name": "d3.svg.area"},
{"name": "d3.svg.line"},
{"name": "d3.scale"},
{"name": "d3.scale.linear"},
{"name": "d3.scale.ordinal"}
],