Skip to content

Instantly share code, notes, and snippets.

View macbre's full-sized avatar
🏠
Working from home

Maciej Brencz macbre

🏠
Working from home
View GitHub Profile
@macbre
macbre / gist:8933000
Created February 11, 2014 11:10
unblockUploads.js
var cities =[879,1491];
// wgUploadMaintenance = false
cities.forEach(
function(cityId) {
$.post('/wiki/Special:WikiFactory?action=select', {
action:'ajax',
rs: 'axWFactoryRemoveVariable',
cityid: cityId,
varCityid: cityId,

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@macbre
macbre / README.md
Last active August 29, 2015 14:01
SlimerJS playground

Droplet installation

Debian 7

Missing libraries:

libasound.so.2: cannot open shared object file: No such file or directory
libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
@macbre
macbre / ep2014.md
Last active August 29, 2015 14:04
EuroPython2014 notes

Tuesday, July 22th

TDD

  • TDD is hard, especially for legacy code
  • start with integration tests
  • input -> output pairs

Amanda - services platform

@macbre
macbre / fussball-ir.md
Last active August 29, 2015 14:04
Fussball IR system
@macbre
macbre / debian.md
Last active August 29, 2015 14:05
Debian tools

Panoramy

apt-get install hugin autopano-sift-c

HDR

apt-get install qtpfsgui
@macbre
macbre / map.geojson
Last active August 29, 2015 14:05
GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@macbre
macbre / perfcap.js
Last active August 29, 2015 14:07 — forked from gleicon/perfcap.js
var page = require('webpage').create(),
MSG_SCREENSHOT = '123screenshot123';
page.onConsoleMessage = function(msg) {
if (msg === MSG_SCREENSHOT) {
page.render('screenshot.png');
phantom.exit()
}
console.log('INFO: ' + msg);
};
@macbre
macbre / chrome-first-paint.js
Created October 21, 2014 20:40
Chrome's first paint timing
// first paint in chrome from https://github.com/addyosmani/timing.js
var hasFirstPaint = 0;
if (window.chrome && window.chrome.loadTimes) {
var paint = window.chrome.loadTimes().firstPaintTime * 1000;
var firstPaint = paint - (window.chrome.loadTimes().startLoadTime*1000);
var firstPaintLeft = (firstPaint / loaded)*100;
hasFirstPaint = 1;
}