Skip to content

Instantly share code, notes, and snippets.

View Boldewyn's full-sized avatar

Manuel Strehl Boldewyn

View GitHub Profile
@addyosmani
addyosmani / vendorPrefix.js
Created April 21, 2011 06:33
JS snippet for getting the current vendor prefix of a CSS(3) property
function getPrefix( prop ){
var vendorPrefixes = ['Moz','Webkit','Khtml','O','ms'],
style = document.createElement('div').style,
upper = prop[0].toUpperCase() + prop.slice(1),
pref, len = vendorPrefixes.length;
while( len-- ){
if((vendorPrefixes[len] + upper) in style){
pref = (vendorPrefixes[len]);
}
}
@Boldewyn
Boldewyn / README
Created May 28, 2011 18:34
HTTP Error Responses by MIME Type
This is a collection of templates, that depict HTTP error messages in different MIME types.
Each template expects the parameters
* {CODE} - the numeric HTTP error code
* {PHRASE} - the reason phrase, e.g., "Not Found" for 404
and in some cases the parameter
@pamelafox
pamelafox / Makefile
Created October 13, 2011 21:43
Closure/YUI/JsHint Makefile
# Makefile for JS/CSS:
# Uses Closure for JS compiling, YUI for CSS compiling, and JsHint for code quality checking
MAKEFLAGS = --no-print-directory --always-make
MAKE = make $(MAKEFLAGS)
BUILDDIR = ./.build
CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip
CLOSUREDIR = $(BUILDDIR)/closure
@jviereck
jviereck / gist:1953505
Created March 1, 2012 21:56 — forked from brendandahl/gist:1953439
About Printing On The Web

Version: 01-Mar-2012
Author: Julian Viereck <jviereck (dot) dev (at) googlemail (dot) com>

About Printing On The Web

tl;dr

Printing on the web is very limited. There is CSS3 Paged Media "Last Call" spec, that improves things, but has not been adopted by browsers yet. How about creating a new "WebPrintAPI" that does not use the DOM but is more like a simple canvas API? Would such a simple API be helpful for your printing needs on the web, or is it just suitable for very special use cases like PDF.JS?

Please leave a comment - I would really like to get your feedback on this!

@Boldewyn
Boldewyn / mk
Last active December 17, 2015 07:48
Search Makefiles recursively and run make(1) there, if one is found
#!/bin/bash
#
# Search Makefiles recursively and run make(1) there, if one is found
#
DEPTH=$(pwd | tr -c -d / | wc -c)
MOD=.
while [[ $DEPTH > 0 ]]
do
@Boldewyn
Boldewyn / evaluate_404s
Created August 28, 2013 09:27
Use bash-foo to print all Apache log 404s in the order how often they appeared
#!/bin/bash
LOGFOLDER=/var/log/apache2
FIELD=7
HTTP_CODE=404
LOG_BASENAME=access.log
cd "$LOGFOLDER"
# print all zipped logfiles (suppressing errors)
@Ed-von-Schleck
Ed-von-Schleck / gist:6391140
Last active December 22, 2015 00:39
Argumentor - generator a command line interface
import sys
if sys.version_info.major != 3 or sys.version_info.minor < 3:
print("This module requires Python version 3.3 or later")
sys.exit(1)
import argparse
import inspect
class Argumentor:
@cowboy
cowboy / get-script.js
Last active December 23, 2015 23:59
javascript: get last script by src filename
// For Remy
function getLastScriptBySrc(filename) {
var scripts = document.scripts;
var i = scripts.length - 1;
while (i--) {
if (scripts[i].src.slice(-filename.length) === filename) {
return scripts[i];
}
}
@kanmeiban
kanmeiban / Why Recruiters Are Universally Hated
Created November 22, 2013 20:22
Dealing with recruiters is as nice as dealing with faecal matter. You'd better flush as soon as possible.
Why Recruiters Are Universally Hated
On 14. January 2013 I was invited for a job interview in London by Mr Ethan James of recruiting company
TestDriven IT Group on behalf of his client, a start-up looking for Ruby on Rails developer. Mr Ethan
James proposed I should fly with a low cost jet to get full reimbursement on my tickets. Hower I prefer
rail and sea transport to air travel beacause of their smaller environmental footprint so we agreed that
TestDriven IT Group will cover only half of my travel costs. The interview went well, I wasn’t hired so
I traveled back to my home country through the snow covered Europe, sent a scan of the tickets to the
recruiters upon my arrival and waited for the reimbursement to come.

Earlier, amidst many other tweets about a new css preprocessor, Myth, I tweeted "Avoid snake oil, people. It takes more than a pretty website and a good marketing message. You have to actually deliver code that works." to which @necolas replied "assume your peers have good intentions".

Absolutely. This is sound life advice. I endeavor to do this and the message I wanted to convey to everyone today could have been conveyed without resorting to using such negative phrases as "snake oil". So to the guys at Segment.io and especially to Ian Storm Taylor, I'd like to say I'm sorry. I was frustrated, but that doesn't excuse that tweet.

I'd like to talk briefly about why I was so frustrated.

Even people with great intentions can still do harm. Recently a nice guy decided he would give away a thousand dollars by ["making it rain" dollars at a mall](http://abclocal.go.com/kabc/sto