Skip to content

Instantly share code, notes, and snippets.

Julien Valéry darul75

View GitHub Profile
View gist:a8a5cddcefb502431dfc
var WIDTH, HEIGHT, canvas, con, g;
var pxs = [];
var rint = 50;
$(document).ready(function() {
$('.get-year').text(new Date().getFullYear());
var $clones = $(".testimonial-list li").clone().sort(function() {
return 0.5 - Math.random();
}).slice(0, 4).removeClass("hidden");
$(".testimonial-list").empty().append($clones);
var windowSize = function() {
View gist:ca6bbc23fca2bcc0a564
* Empty cache
npm cache clean
* Uninstall module
npm uninstall [module_name]
* Install module version
npm install [module_name]@[version]
View twitter-entities.js
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
View ng-i18next-filter.js
angular.module('myApp')
.run(['$rootScope', function ($rootScope) {
window.i18n.init(options, function () {
// When finished loading translations, trigger re-evaluation of views for translations
$rootScope.$digest();
});
}])
.filter('translate', [function(){
return function(key, params) {
// i18next needs time to initialize (loading translations). In this phase translation does not work
@darul75
darul75 / gist:7b17026d40df3e236f5f
Created May 3, 2014
sick beard on mint or linux easy way start as a service
View gist:7b17026d40df3e236f5f
follow instructions here first:
http://sickbeard.com/install.html
then
mv my-sickbeard-install/ .sickbeard
sudo mv .sickbeard/init.ubuntu /etc/init.d/sickbeard
sudo gedit /etc/init.d/sickbeard
@darul75
darul75 / helper_jpeglib.txt
Last active Aug 23, 2017
Max OS fatal error: 'jpeglib.h' file not found
View helper_jpeglib.txt
Use Brew
> brew install libjpeg
find /usr | grep "libjpeg"
find /opt | grep "libjpeg"
Here what I have done
@darul75
darul75 / buttons.css
Last active Aug 29, 2015
CSS Play Pause Buttons
View buttons.css
.play_border {
margin:5px;
border: 2px solid rgba(0,0,0,0.7);
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
width: 20px;
height: 20px;
-webkit-box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.5);
View README.md

This demonstrates raster-based reverse geocoding using canvas and D3.js. Geocoding is based on the color of the pixel at a given projected position. Note that the canvas is only shown here for the sake of explanation and debugging - this would in fact probably work faster if the canvas was not attached to the document at all.

The biggest remaining issue here is precision, which depends on:

  • the size of the canvas, and
  • the projection used.

Determining the optimum size based on the accuracy of your data is left as an exercise for the reader. Edge cases will also fail here, generally returning null - one option might be to stroke neighborhoods in a color, and then return an "uncertain" value for any non-grayscale pixel.

View europe.topo.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View canvas.html
<canvas width=220 height=150></canvas>
You can’t perform that action at this time.