Skip to content

Instantly share code, notes, and snippets.

View chrisfrancis27's full-sized avatar
Verified beard

Chris Francis chrisfrancis27

Verified beard
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/konvajs/konva/1.7.4/konva.min.js"></script>
<meta charset="utf-8">
<title>Konva Clipping Function Demo</title>
<style>
body {
margin: 0;
@chrisfrancis27
chrisfrancis27 / .block
Created June 12, 2017 19:41 — forked from mbostock/.block
Force-Directed Graph
license: gpl-3.0
height: 600
@chrisfrancis27
chrisfrancis27 / .block
Last active February 21, 2017 11:48 — forked from mbostock/.block
Canvas Line
license: gpl-3.0
@chrisfrancis27
chrisfrancis27 / index.html
Created November 29, 2016 12:18
D3 transition background scheduling
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 100px;
margin: 0 auto;
@chrisfrancis27
chrisfrancis27 / migration.js
Created March 11, 2016 14:35
Knex 0.10.0 `undefined -> DEFAULT` test
'use strict';
exports.up = function(knex) {
return knex.schema
.createTable('things', t => {
t.increments('id').primary().unsigned();
t.text('a').notNullable().defaultTo('');
t.integer('b').notNullable().defaultTo(0);
t.boolean('c').notNullable().defaultTo(false);
})
@chrisfrancis27
chrisfrancis27 / pre-commit
Created February 17, 2016 20:47
Git pre-commit hook for warning about new occurrences of a string, e.g. "// TODO"
#!/bin/bash
# Change $stopword to whatever string you want to disallow
# N.B. It's going into a regex, so don't be ridiculous.
stopword="TODO"
########################################
# You shouldn't need to touch anything #
@chrisfrancis27
chrisfrancis27 / gist:35c6e557b46b5a5d5369
Created February 17, 2016 16:14 — forked from guilherme/gist:9604324
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@chrisfrancis27
chrisfrancis27 / example.js
Created January 25, 2016 11:51
Bookshelf hash IDs
'use strict';
const _ = require('lodash');
const bookshelf = require('../config/bookshelf');
const hasher = require('../utils/hasher');
require('./thing');
let Example = Bookshelf.model.extend({
tableName: 'examples',
@chrisfrancis27
chrisfrancis27 / config
Last active August 29, 2015 14:16
Git config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[push]
default = tracking
[remote "origin"]
@chrisfrancis27
chrisfrancis27 / Preferences.sublime-settings
Last active August 29, 2015 14:09
Sublime Text 3 user settings (OSX)
{
"always_show_minimap_viewport": true,
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_style": "smooth",
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"copy_with_empty_selection": true,
"detect_indentation": false,
"draw_minimap_border": true,
"enable_tab_scrolling": false,