Skip to content

Instantly share code, notes, and snippets.

@leonderijke
leonderijke / svgfixer.js
Last active May 26, 2023 11:22
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html
@leommoore
leommoore / nano_js_syntax_highlighting.md
Last active October 5, 2023 21:21
nano javascript syntax highlighting

#nano javascript syntax highlighting

The existing syntax highlighting is located in /usr/share/nano/

To add a new language

sudo nano /usr/share/nano/javascript.nanorc

Put the following in the contents:

@paniq
paniq / morph.glsl
Created July 1, 2014 04:52 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
const float strength=0.1;
void main() {
vec2 p = gl_FragCoord.xy / resolution.xy;
@nwoeanhinnogaehr
nwoeanhinnogaehr / Kaleidoscope.glsl
Created May 23, 2014 19:02 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
uniform float speed;
uniform float angle;
uniform float power;
@benraziel
benraziel / pixelize.glsl
Created May 20, 2014 19:32 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
float rand(vec2 co){
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
@gre
gre / burn.glsl
Created May 20, 2014 09:06 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
uniform vec3 color;
void main() {
@gre
gre / randomsquares.glsl
Last active April 17, 2016 10:50 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
// General parameters
uniform sampler2D from;
uniform sampler2D to;
uniform float progress;
uniform vec2 resolution;
@branneman
branneman / app.js
Last active February 5, 2021 21:58
Node.js application entry-point files
#!/usr/bin/env node
'use strict';
var spawn = require('child_process').spawn;
var args = [
'--harmony',
'app/bootstrap.js'
];
@FGRibreau
FGRibreau / 0_readme.md
Created November 2, 2013 22:56
Mock NodeJS net.Socket with ReadWriteStream
var dummySocket = new ReadWriteNetStream();

// Debug
dummySocket.on('data', function(data){
console.log('write received', data);
});

dummySocket.write('hey !');
@willurd
willurd / web-servers.md
Last active May 25, 2024 13:16
Big list of http static server one-liners

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