Skip to content

Instantly share code, notes, and snippets.

mzur / ImageCanvas.js
Created Oct 24, 2018
OpenLayers ImageStatic with canvas source
View ImageCanvas.js
import ImageStatic from 'ol/source/ImageStatic';
import ImageCanvas from 'ol/ImageCanvas';
import EventType from 'ol/events/EventType';
import {listen} from 'ol/events';
class Canvas extends ImageStatic {
constructor(options) {
this.image_ = new ImageCanvas(options.imageExtent, 1, 1, options.canvas);
listen(this.image_, EventType.CHANGE, this.handleImageChange, this);
mzur /
Last active Apr 26, 2021 — forked from rodw/
A simple script to backup an organization's GitHub repositories, wikis and issues.
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username); also see the note below about the `REPOLIST` definition around line 48
mzur / contact-send.php
Last active Sep 11, 2015
Old version of the AJAX response template (
View contact-send.php
$errors = '';
// check each parameter of the request if it is erroneous
foreach (array_keys(get()) as $field) {
$errors .= $form->hasError($field) ? "\"$field\"," : '';
// strip trailing comma
$errors = substr($errors, 0, -1);
mzur /
Last active Aug 29, 2015
Force layout with labeled links

A simple force layout with labeled links. The labels appear only if the adjacent nodes are hovered.

mzur / Control.Button.js
Last active Oct 10, 2021 — forked from emtiu/leaflet.button.js
Simple custom Leaflet Control button.
View Control.Button.js
// from
// Usage:
// var someButton = new L.Control.Button(options).addTo(map);
// This calls OnAdd(). See the code for what options are required
// The third parameter passed to L.DomEvent.addListener is the 'this' context
// to use in the callback (second parameter).
L.Control.Button = L.Control.extend({
options: {
mzur /
Last active Dec 15, 2015
How to set up gedit with automatic LESS CSS compiling

#How to set up gedit with automatic LESS CSS compiling

##Install the compiler

Install the command line LESS compiler. For example in Ubuntu use sudo apt-get install node-less. Alternatively you can install it using the Node Package Manager sudo atp-get install npm and then npm install -g less for the guaranteed newest version.

Now you are able to compile LESS files using lessc my_less_file.less my_css_file.css but this really sucks if you are setting up the CSS for a new website and have to compile it frequently.

Fortunately there is gedit; the lightweight text editor of your choice ;-)