Skip to content

Instantly share code, notes, and snippets.

Ashish Singh git-ashish

Block or report user

Report or block git-ashish

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
@veltman
veltman / README.md
Last active Sep 13, 2019
Flocking boids
View README.md
@mrcslws
mrcslws / .block
Last active May 7, 2019 — forked from mbostock/.block
Pan & Zoom Axes
View .block
license: gpl-3.0
@pbeshai
pbeshai / .block
Last active Sep 10, 2019
Animate thousands of points with canvas and D3
View .block
license: mit
height: 620
border: no
@emeeks
emeeks / README.md
Last active Jun 6, 2019
Network Annotation with Collision Detection
View README.md

Using collision detection with network visualization labels

This demonstrates how to use d3-annotation() with bboxCollide to procedurally place node labels. After using the nodes data to create a network visualization of the Les Miserables play, we filter the nodes to leave out the side characters and pass that array to d3-annotation. We then create a second forceSimulation, this time using the size of the notes as the property in our bounding box collision detection, to move the labels out of each others' way.

d3-annotation by Susie Lu.

@drzax
drzax / .block
Last active Sep 13, 2019
Narrative Charts
View .block
license: mit
scrolling: true
height: 300
@mbostock
mbostock / .block
Last active Sep 30, 2019
Star Map
View .block
license: gpl-3.0
height: 960
redirect: https://observablehq.com/@mbostock/star-map
@mbostock
mbostock / .block
Last active Jul 5, 2019
Line with Missing Data
View .block
license: gpl-3.0
redirect: https://observablehq.com/@d3/line-with-missing-data
@paulirish
paulirish / what-forces-layout.md
Last active Oct 21, 2019
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@maxogden
maxogden / 0.md
Last active Sep 28, 2019
JS hoisting by example
View 0.md

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@myusuf3
myusuf3 / delete_git_submodule.md
Created Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
You can’t perform that action at this time.