Skip to content

Instantly share code, notes, and snippets.

@Geruhn
Geruhn / search_shortcut.user.js
Last active August 29, 2015 13:57
Ctrl + M becomes a shortcut to the search bar of the site.
// ==UserScript==
// @name Search Shortcut
// @namespace andyperdana.de
// @version 0.3
// @description Ctrl+M is goToSearch
// @include /^https?://(www\.)?.*\..*/
// @exclude http://update001.maminfra.bs.kae.de.server.lan/updatetool/*
// @downloadUR https://gist.githubusercontent.com/Geruhn/9809298/raw/0d3fee8c6da586650572a1e28054fb6833ab41c6/search_shortcut.user.js
// @copyright 2012+, You
// @homepage https://gist.githubusercontent.com/Geruhn/9809298/raw/9577bc50e2d058986afa8b831905c23ed79973e7/search_shortcut.user.js

Keybase proof

I hereby claim:

  • I am geruhn on github.
  • I am geruhn (https://keybase.io/geruhn) on keybase.
  • I have a public key whose fingerprint is 65C7 F2FA 12F5 2F8C 6146 8F18 BD0A B87E FBDF 375C

To claim this, I am signing this object:

@Geruhn
Geruhn / gist:6291349
Last active December 21, 2015 10:19
JavaScript: jsChecker
$(document).ready(function() {
var jsChecked = document.createAttribute('class');
jsChecked.nodeValue = 'js';
document.getElementsByTagName('body')[0].setAttributeNode(jsChecked);
});
@Geruhn
Geruhn / gist:6303666
Created August 22, 2013 06:00
CSS: Image Replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@Geruhn
Geruhn / .gitconfig
Last active December 21, 2015 14:28
Git: Standard .gitconfig
[color]
ui = true
[alias]
go = checkout
ci = commit -m
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
<?php
// define the path and name of cached file
$cachefile = 'cached-files/'.date('M-d-Y').'.php';
// define how long we want to keep the file in seconds. I set mine to 5 hours.
$cachetime = 18000;
// Check if the cached file is still fresh. If it is, serve it up and exit.
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
include($cachefile);
exit;
}
@Geruhn
Geruhn / gist:6389735
Last active December 22, 2015 00:29
JavaScript: Custom Each mit Callback Quelle: http://www.sitepoint.com/jquery-vs-raw-javascript-3-events-ajax/
function Each(obj, fn) {
if (obj.length) for (var i = 0, ol = obj.length, v = obj[0]; i < ol && fn(v, i) !== false; v = obj[++i]);
else for (var p in obj) if (fn(obj[p], p) === false) break;
};
@Geruhn
Geruhn / Responsive_Twitter.css
Last active December 28, 2015 08:28
Making Twitter responsive with a greasemonkey script
@media (min-width: 701px) {
.dashboard {
position: fixed;
}
}
@media (max-width: 900px) and (min-width: 701px) {
.wrapper {
width: 100%;
padding: 54px 0px 0px 0px;
@Geruhn
Geruhn / add_remove_toggle_Many.js
Created November 25, 2013 17:01
JavaScript: (add|remove|toggle)Many
DOMTokenList.prototype.addMany = function(classes) {
var classes = classes.split(' ');
for (var i = classes.length - 1; i >= 0; i--) {
this.add(classes[i]);
};
};
DOMTokenList.prototype.removeMany = function(classes) {
var classes = classes.split(' ');
for (var i = classes.length - 1; i >= 0; i--) {