Skip to content

Instantly share code, notes, and snippets.

View Greg-Johns's full-sized avatar

Greg Johns Greg-Johns

View GitHub Profile
@Greg-Johns
Greg-Johns / .block
Last active November 15, 2016 17:37 — forked from mbostock/.block
Relative presidential voting power
license: gpl-3.0
# Mastery of Vimscript
A student enquired of Master Wq, "When will I know I have mastered Vimscript?"
Master Wq answered, "When you never use it."
@Greg-Johns
Greg-Johns / gist:d467861b17de5cd34b5a50832fe87679
Created May 27, 2016 16:23
Iterating over Array indices and elements via the for-of loop
const arr = ['a', 'b', 'c'];
for (const [index, elem] of arr.entries()) {
console.log(`index = ${index}, elem = ${elem}`);
}
@Greg-Johns
Greg-Johns / vim
Last active December 29, 2015 14:16 — forked from athieriot/vim
Vim
--------------------------------
BASICS
--------------------------------
i / insert
u / Undo
<ctrl-r> / Redo
:q / quit
:q! / force
@Greg-Johns
Greg-Johns / dabblet.css
Last active November 27, 2015 22:43 — forked from anonymous/dabblet.css
Attempt for Chrome-style gears with SVG and CSS animations
/**
* Attempt for Chrome-style gears with SVG and CSS animations
*/
body {
background-color: #ccc;
}
@keyframes spin {
to {
stroke-dashoffset: -100;
git log --tags --simplify-by-decoration --pretty="format:%ai %d"
@Greg-Johns
Greg-Johns / gist:18d791c9435f6b6c6ff2
Last active October 16, 2015 22:33
ES6 import syntax
import name from "module-name";
import * as name from "module-name";
import { member } from "module-name";
import { member as alias } from "module-name";
import { member1 , member2 } from "module-name";
import { member1 , member2 as alias2 , [...] } from "module-name";
import defaultMember, { member [ , [...] ] } from "module-name";
import defaultMember, * as alias from "module-name";
import defaultMember from "module-name";
import "module-name";
@Greg-Johns
Greg-Johns / my-git-log.sh
Created October 16, 2015 19:45 — forked from ZeroBugBounce/my-git-log.sh
Various git log techniques
$ git log -80 --pretty=format:'%C(yellow)%h%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges | grep -v 'chef'
@Greg-Johns
Greg-Johns / index.js
Created June 29, 2014 02:49
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@Greg-Johns
Greg-Johns / dabblet.css
Created June 18, 2013 21:05 — forked from LeaVerou/dabblet.css
Pounding heart animation
/* Pounding heart animation */
@keyframes pound {
to { transform: scale(1.4); }
}
.heart {
display: inline-block;
font-size: 150px;
color: #e00;