Skip to content

Instantly share code, notes, and snippets.

View philrenaud's full-sized avatar
📊

Phil Renaud philrenaud

📊
View GitHub Profile
@mattdesl
mattdesl / ComplexSketch.svelte
Last active October 3, 2021 21:32
svelte musings
<script>
import delaunay from 'delaunay-triangulate';
import { Slider, Color } from 'texel/ui';
// This will get passed in with the P5 instance
export let p5;
// Size of the canvas in pixels
export let width = 256;
export let height = 256;
@philrenaud
philrenaud / Insert jQuery, Underscore, and D3
Last active November 19, 2018 17:15
Import a few necessary packages into your browser's instance of any webpage
// add jquery:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js';
document.head.appendChild(script);
// add underscore:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js';
@donut
donut / 0-Instructions.markdown
Last active August 29, 2015 14:04
How to get Compass like sprites with Stylus and SVG

Using the grunt-dr-svg-sprites GruntJS plugin and a custom Handlebars template (below) I was able to get the basic functionality that Compass provides for PNG sprites but for SVGs.

Note that the below template is not generalized and will not work for all dr-svg-sprites configurations. It works for my setup and would probably be a good base for others.

I've included the relevant portions of my Gruntfile as well.

@SleeplessByte
SleeplessByte / silly.js
Created February 3, 2014 18:40
Javascript is silly
"J"+(([]===[])+/-/)[1]+/\[[^1]+\]/[([]+![])[1<<1<<1]+(/|/[(1+{})[1+11>>>1]+[[]+{}][+!1][1]+([]+1/[])[1<<1>>1]+([1<1]+[])[1+11>>>1+1]+[[!!1]+1][+[]][1-1]+([]+!!/!/)[1|1]+(/1/[1]+[])[!1%1]+(-{}+{})[-1+1e1-1]+(1+[!!1])[1]+([]+1+{})[1<<1]+[!!/!!/+[]][+[]][1&1]]+/=/)[1e1+(1<<1|1)+(([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]])[1^1]==+!1)]+(!![]+{})[1|1<<1]+[1+{}+1][!1+!1][(11>>1)+1]](([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]]))[1&.1][11>>>1]+(([]===[])+/-/)[1]+([1<1]+[])[1+11>>>1+1]+(1+{})[1+11>>>1]+[!!/!!/+[]][+[]][1&1]+/\[[^1]+\]/[([]+![])[1<<1<<1]+(/|/[(1+{})[1+11>>>1]+[[]+{}][+!1][1]+([]+1/[])[1<<1>>1]+([1<1]+[])[1+11>>>1+1]+[[!!1]+1][+[]][1-1]+([]+!!/!/)[1|1]+(/1/[1]+[])[!1%1]+(-{}+{})[-1+1e1-1]+(1+[!!1])[1]+([]+1+{})[1<<1]+[!!/!!/+[]][+[]][1&1]]+/=/)[1e1+(1<<1|1)+(([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]])[1^1]==+!1)]+(!![]+{})[1|1<<1]+[1+{}+1][!1+!1][(11>>1)+1]](([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[
@caged
caged / d3-server.js
Last active October 17, 2023 04:05
Directly render and serve d3 visualizations from a nodejs server.
// Start `node d3-server.js`
// Then visit http://localhost:1337/
//
var d3 = require('d3'),
http = require('http')
http.createServer(function (req, res) {
// Chrome automatically sends a requests for favicons
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't
// fixed or this is a regression.
@mcsheffrey
mcsheffrey / gist:4265121
Created December 12, 2012 05:37
¯\_(ツ)_/¯
¯\_(ツ)_/¯