Skip to content

Instantly share code, notes, and snippets.

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

Elwin Schmitz elwinschmitz

🏠
Working from home
View GitHub Profile
@elwinschmitz
elwinschmitz / Custom.css
Created March 9, 2012 10:53 — forked from lensco/Custom.css
Chrome-User-stylesheet to customize the WebKit Inspector
/*
Copy to:
%LocalAppData%\Google\Chrome\User Data\Default\User StyleSheets\Custom.css
*/
/*
twitter.com/
*/
@elwinschmitz
elwinschmitz / bookmarklet-edit-viewport.js
Last active October 3, 2015 13:57
Bookmarklet: Edit viewport
(function () {
var t=document.querySelector('meta[name=viewport]');
t.content=window.prompt('New viewport:',t.content);
}())
@elwinschmitz
elwinschmitz / define-breakpoints-once.html
Created April 25, 2012 08:24
Define media-query breakpoints only once
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Single point of breakpoint-definition</title>
<style>
/*
Baseline:
*/
@elwinschmitz
elwinschmitz / log-viewer.html
Created July 13, 2012 13:26
A simple (console).log viewer. Especially handy for iOS-devices.
<!doctype html>
<title>iOS console.log viewer</title>
<script>
((function(){
window.log = function(){
log.history = log.history || []
log.history.push(arguments)
@elwinschmitz
elwinschmitz / bookmarklet-toggle-env.js
Last active August 29, 2015 14:24
Bookmarklet: ⇄ Toggle ENV
(function(){
var ENV='.env';
if(location.href.search(ENV)>=0){
location.href=location.href.replace(ENV,'');
}else{
location.href=location.origin+ENV+location.pathname+location.search+location.hash;
}
}());
@elwinschmitz
elwinschmitz / bookmarklet-toggle-a-b.js
Created August 6, 2015 16:05
Bookmarklet: nl ⇄ be
(function(){
var url=document.location.href,A='.nl',B='.be';
if(url.indexOf(A)!==-1) {
url=url.replace(A,B);
}else{
url=url.replace(B,A);
};
document.location.href=url;
})();
(function(){
var flag = "debug",
params = document.location.search.substr(1).split("&");
if (params.indexOf(flag) !== -1) {
params.splice(params.indexOf(flag), 1);
} else {
params.push(flag);
}
query = params.join("&");
query = query.replace(/^&/, "");
@elwinschmitz
elwinschmitz / bookmarklet-internetarchive-version.js
Last active October 19, 2016 13:15
Lookup in Internet Archive
document.location.href="https://web.archive.org/web/*/"+document.location.href;
(function(){
function reloadCSS() {
var now = Date.now();
var stylesheets = document.querySelectorAll('link[rel=stylesheet][href]');
window.console.info('Reload! ' + now);
Array.prototype.forEach.call(stylesheets, function (element) {
var newUrl = element.href.replace(/(&|%5C?)forceReload=\d+/, '');
element.href = newUrl + (newUrl.match(/\?/) ? '&' : '?') + 'forceReload=' + now;
});