Skip to content

Instantly share code, notes, and snippets.

View RangerMauve's full-sized avatar
💜
Decentralizing

Mauve Signweaver RangerMauve

💜
Decentralizing
View GitHub Profile
https?:\/\/.*\/(.*?).(jpe?g|gif|png)
@RangerMauve
RangerMauve / gist:3628bed7a25cd79a6394
Created January 19, 2015 22:26
Facade duplex streams
//https://www.npmjs.com/package/duplexer
var duplexer = require("duplexer");
var through = require("through2");
function boostrap(fn){
var input = noop(); // Just passes data through
var output = noop(); // Just passed data through;
input.once("data",function(chunk, encoding, cb){
@RangerMauve
RangerMauve / index.js
Created April 29, 2015 14:58
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Ractive = require("ractive");
var Swipe = require("ractive-swipe-pages");
var ractive = new Ractive({
el: '#container',
template: '#template',
data: {
toggled: true
conspicor (Behold) -> Observable library
nexilis (Tied) -> Templating library
@RangerMauve
RangerMauve / gist:6459981
Last active December 22, 2015 10:38
golfjs #5
i=input
output=i.split("").reverse().join("")==i
@RangerMauve
RangerMauve / gist:6459971
Last active December 22, 2015 10:39
golf.js #6
s='*'
i=input
a=Array
j='join'
r=a(i+1)[j](s)
c=a(--i)
b='\n'+s+c[j](' ')+s
output=r+c[j](b)+(i?'\n'+r:'')
@RangerMauve
RangerMauve / gist:6459974
Created September 6, 2013 05:43
golfjs #3
function d(r){return(input.match(r)||[]).length}output=d(/[aeiou]/gi)+d(/y/gi)/2
@RangerMauve
RangerMauve / gist:6493945
Last active December 22, 2015 15:39
Create a sphere of radius 1 from altitude and azimuth.
function makeVec(altitude,azimuth){
var x, y, z, hyp, vector;
z = Math.sin(altitude);
hyp = Math.cos(altitude);
y = hyp*Math.cos(azimuth);
x = hyp*Math.sin(azimuth);
vector = new Vector(x,y,z);
return vector;
}
@RangerMauve
RangerMauve / 1337_5P34K3R.js
Last active December 22, 2015 23:19
Leet Text Bookmarklet. To use, make a new bookmark and then copy paste the code into the URL field, when made just click the bookmark with a textbox selected.
javascript:void(
function(inp,el,mp,k){
el=document.activeElement||{};
inp=el.value||'';
mp={'is':/is/ig,'0':/o/ig,'1':/[il]/ig,'3':/e/ig,'4':/a/ig,'5':/s/ig,'7':/t/ig,'©':/c/ig,'Я':/r/ig,'м':/m/ig};
for(k in mp)inp=inp.replace(mp[k],k);
el.value=inp;
}());
@RangerMauve
RangerMauve / XKCD1288.user.js
Last active December 27, 2015 19:59
This is a filter I made that makes reading news more fun, I got the idea from http://xkcd.com/1288/. Since it's a userscript it should be easily install-able in Chrome or Firefox. In chrome it's as simple as downloading this file and dragging it into your "extensions" window.
// ==UserScript==
// @name FunNewsSubstitutions
// @namespace http://mauve.us.to
// @description This is a filter I made that makes reading news more fun, I got the idea from http://xkcd.com/1288/. Since it's a userscript it should be easily install-able in Chrome or Firefox
// @include *
// ==/UserScript==
// Wrapper to keep things in their own scope
(function(){