Skip to content

Instantly share code, notes, and snippets.

Avatar

Manuel Strehl Boldewyn

View GitHub Profile
@addyosmani
addyosmani / vendorPrefix.js
Created Apr 21, 2011
JS snippet for getting the current vendor prefix of a CSS(3) property
View vendorPrefix.js
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
HTTP Error Responses by MIME Type
View README
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 Oct 13, 2011
Closure/YUI/JsHint Makefile
View 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 Mar 1, 2012 — forked from brendandahl/gist:1953439
About Printing On The Web
View gist:1953505

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 Dec 17, 2015
Search Makefiles recursively and run make(1) there, if one is found
View mk
#!/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 Aug 28, 2013
Use bash-foo to print all Apache log 404s in the order how often they appeared
View evaluate_404s
#!/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 Dec 22, 2015
Argumentor - generator a command line interface
View gist:6391140
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 Dec 23, 2015
javascript: get last script by src filename
View get-script.js
// 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];
}
}
@mathiasbynens
mathiasbynens / README.md
Last active Dec 26, 2015
Quick and dirty user script that displays a Markdown-formatted link to the current code point detail page after double-clicking the title
View README.md

Try it on the detail page for U+1F4A9 PILE OF POO, for example.

Screenshot after double-clicking the <h1>:

@kanmeiban
kanmeiban / Why Recruiters Are Universally Hated
Created Nov 22, 2013
Dealing with recruiters is as nice as dealing with faecal matter. You'd better flush as soon as possible.
View Why Recruiters Are Universally Hated
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.