Skip to content

Instantly share code, notes, and snippets.

Avatar
💫

Moritz moklick

💫
View GitHub Profile
@moklick
moklick / countries.topo.json
Last active Apr 3, 2020
Maps with TopoJSON, Leaflet & Chroma.js http://blog.webkid.io
View countries.topo.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View german-number-format.js
import { formatDefaultLocale } from 'd3-format';
const germanNumberFormat = formatDefaultLocale({
decimal: ',',
thousands: '.',
grouping: [3],
currency: ['€', '']
});
export function numberFormat(num, decimals = 0) {
@moklick
moklick / content.js
Created Jan 2, 2018
was ist das fuer 1 extension
View content.js
// via http://stackoverflow.com/questions/10730309/find-all-text-nodes-in-html-page#answer-10730777
function findTextNodes(el) {
var node;
var textNodes = [];
var walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false);
while (node = walk.nextNode()) {
textNodes.push(node);
}
return textNodes;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am moklick on github.
  • I am moklick (https://keybase.io/moklick) on keybase.
  • I have a public key ASCRAEeOQsPTamLtJzCu8u1sdYvSq43rr2iOmsyPIAU5Qgo

To claim this, I am signing this object:

View teaser-hotfix.js
(function(){
// check browser support
if (!document.querySelectorAll || ![].forEach) {
return false;
}
// search teasers
var teasers = document.querySelectorAll('.teaser-leader-m');
[].forEach.call(teasers, function(d) {
@moklick
moklick / leaflet-crs-mapbox.js
Created Apr 18, 2016
A custom CRS for Leaflet in order to display mapbox raster tiles
View leaflet-crs-mapbox.js
const customCRS = L.extend({}, L.CRS.Earth, {
projection: L.Projection.SphericalMercator,
transformation: (function () {
var scale = 0.5 / (Math.PI * L.Projection.SphericalMercator.R);
return new L.Transformation(scale, 0.5, -scale, 0.5);
}()),
scale: function (zoom) {
return 512 * Math.pow(2, zoom);
}
});
View ...-is-watching-you.markdown
View CCTV-Everywhere.markdown

CCTV Everywhere

Cookies? Oldschool!! I use CCTV cams to track my users! Watch your step, they are everywhere.

A Pen by moklick on CodePen.

License.

@moklick
moklick / german number formats
Created Oct 14, 2013
functions to enforce german number formats
View german number formats
// from 1337 to 1.337
function formatNumber(number){
return (parseFloat(number) / 1000).toFixed(3).toString();
}
// from 12.123 to 12,123
function replacePoint(number) {
return number.toString().replace('.', ',');
}
@moklick
moklick / fusionhelper.js
Created Oct 10, 2013
Litte Fusiontable-Query Helper
View fusionhelper.js
var FusionHelper = {
query: function(params) {
var base = 'https://www.googleapis.com/fusiontables/v1/query?',
url = base + $.param({
sql: params.sql,
key: '***'
});
$.ajax({
url: url,
type: 'POST',
You can’t perform that action at this time.