Skip to content

Instantly share code, notes, and snippets.

View rbecheras's full-sized avatar
👋

Rémi Becheras rbecheras

👋
View GitHub Profile
@rbecheras
rbecheras / README
Created October 30, 2015 12:53 — forked from emad-elsaid/README
Simple fuzzy search algorithm similar to sublimeText
Simple fuzzy search algorithm similar to sublimeText
this is a simple algorithm to give a similar result
as SublimeText search feature, if you don't use sublimeText
i think you should just give it a shot from here :
http://www.sublimetext.com
to know more about fuzzy search you should check this wiki page:
http://en.wikipedia.org/wiki/Fuzzy_string_searching
@rbecheras
rbecheras / svg2png.js
Created September 22, 2015 22:27 — forked from gustavohenke/svg2png.js
SVG to PNG
var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
@rbecheras
rbecheras / svg-to-png.js
Created September 22, 2015 22:26 — forked from caged/svg-to-png.js
Convert SVG's to PNGs. This works OK if the SVG's styles are inline. The SVG element must contain an xmlns attribute. Webkit also requires you specify a font size on `text` elements.
var svg = document.getElementById('graph'),
xml = new XMLSerializer().serializeToString(svg),
data = "data:image/svg+xml;base64," + btoa(xml),
img = new Image()
img.setAttribute('src', data)
document.body.appendChild(img)
@rbecheras
rbecheras / npm-getting-started.md
Last active August 29, 2015 14:26 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@rbecheras
rbecheras / html5-video-streamer.js
Last active August 29, 2015 14:25 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
//
// Bootstrap the jQuery select UX widget using 'Selecter.js' by Ben Plum
// http://www.benplum.com/formstone/selecter/
//
// Dependancies:
// Angular (duh)
// jQuery (required by selecter.js)
// Selecter.js
//
//

Purpose

Angular directive code to help resize/redraw non-responsive elements (like D3 charts) in a bootstrap responsive design when the window moves across bootstrap boundaries.

(I edited my boostrap to create an extra size for some 7" tablets and landscape phones @ 600px)

What do you think? Good? Bad? Ugly? How could it be better? What other options exist?

Credit to tagtree for the Rickshaw directive help: http://tagtree.tv/d3-with-rickshaw-and-angular