Skip to content

Instantly share code, notes, and snippets.

View gist_markdown_examples.md

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@GerHobbelt
GerHobbelt / emoji-list.md
Last active Jun 14, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View emoji-list.md

A list of GitHub emoji markup, adapted from rxavier's Complete list of github markdown emoji markup, generated with a Grunt script for maintainability (see repository).

Additional original source material: http://unicode.org/emoji/charts/full-emoji-list.html

This table is available as a gist at https://gist.github.com/GerHobbelt/b9b87a2257ddd5251a45628d61385717 and as part of the build repo at https://github.com/GerHobbelt/emoji-list/blob/master/dist/emoji-list.md

Table of Contents

@GerHobbelt
GerHobbelt / remove_git_submodule.sh
Last active May 22, 2020 — forked from moyaldror/remove_git_submodule.sh
Complete remove of git submoule
View remove_git_submodule.sh
#!/bin/bash
#
# Work repo: https://gist.github.com/GerHobbelt/5f084b559d3197c04e90dfd018a00ee6
#
# Sources:
# https://stackoverflow.com/a/16162000/1635910
# https://gist.github.com/myusuf3/7f645819ded92bda6677
# https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule/1260982#1260982
#
if [ $# -ne 1 ]; then
@GerHobbelt
GerHobbelt / what-forces-layout.md
Last active Jun 8, 2019 — forked from paulirish/what-forces-layout.md
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()
@GerHobbelt
GerHobbelt / grammar.jison
Last active Jan 1, 2018 — forked from juliandavidmr/grammar.jison
grammar pseudo language
View grammar.jison
// https://gist.github.com/juliandavidmr/5c545f8cc1fe58d19986625a7a17f756
/* description: Parses end executes mathematical expressions. */
/* lexical grammar */
%lex
%%
\s+ /* skip whitespace */
[0-9]+("."[0-9]+)?\b return 'NUMBER'
@GerHobbelt
GerHobbelt / making-javascript-faster.md
Last active Mar 8, 2022
Making Javascript faster
View making-javascript-faster.md

Making Javascript faster

This is a list of guidelines to make your Javascript faster, often associated with jsPerf benchmarks.

Profile before optimizing

If you have an existing codebase, don't get carried away with premature optimizations. Profile to find the slow bits and pick the low hanging fruit.

@GerHobbelt
GerHobbelt / 0_reuse_code.js
Created Jan 7, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@GerHobbelt
GerHobbelt / README.md
Created Sep 16, 2012 — forked from gtb104/README.markdown
Polybrush Example
View README.md

Here's a d3 plugin that allows you to create a polygon selection. You instantiate it just like d3.svg.brush.

var brush = d3.svg.polybrush();

It has an extra public method that 'brush' does not, and that's 'isWithinExtent(x, y)'. You can use this method to test if a given point falls within the drawn extent.

if (brush.isWithinExtent(x, y)) {
  console.log("I'm inside!");
}
@GerHobbelt
GerHobbelt / README.md
Created Sep 11, 2012 — forked from phoebebright/data.csv
D3 using nest on csv data
View README.md