Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan danneu

  • Texas
View GitHub Profile
@danneu
danneu / text_to_svg_path.py
Created Aug 22, 2020 — forked from CatherineH/text_to_svg_path.py
Convert a text character to an SVG path.
View text_to_svg_path.py
from svgpathtools import wsvg, Line, QuadraticBezier, Path
from freetype import Face
def tuple_to_imag(t):
return t[0] + t[1] * 1j
face = Face('./Vera.ttf')
@danneu
danneu / index.js
Created Mar 21, 2020 — forked from joepie91/index.js
Breaking CloudFlare's "I'm Under Attack" challenge
View index.js
'use strict';
const parseExpression = require("./parse-expression");
function findAll(regex, target) {
let results = [], match;
while (match = regex.exec(target)) {
results.push(match);
}
@danneu
danneu / plink-plonk.js
Created Feb 15, 2020 — forked from tomhicks/plink-plonk.js
Listen to your web pages
View plink-plonk.js
@danneu
danneu / .elm
Last active Aug 6, 2017 — forked from pablohirafuji/defaultvalue-vs-value.elm
Elm defaultValue vs value -- Paste into http://elm-lang.org/try
View .elm
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, onClick)
main =
Html.beginnerProgram { model = Model "" "", view = view, update = update }
type alias Model =
@danneu
danneu / Json.scala
Created Jul 28, 2017 — forked from pchiusano/Json.scala
Simple JSON parser combinator library that does not use zippers
View Json.scala
// WARNING! totally untested, I have only compiled the code! :)
package json
import collection.immutable.Map
import scalaz.{\/, MonadPlus}
import scalaz.\/._
import scalaz.std.vector._
import scalaz.std.map._
import scalaz.std.list._
View gist:bc24fddfcb549192115324ed83f59f10
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@danneu
danneu / app.js
Created Jul 10, 2016 — forked from mjackson/app.js
Using webpack with pixi.js
View app.js
var PIXI = require('pixi.js')
console.log(PIXI)
@danneu
danneu / gulpfile.js
Created Nov 11, 2015 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
View gulpfile.js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@danneu
danneu / 0_reuse_code.js
Created Nov 8, 2015
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
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
You can’t perform that action at this time.