Skip to content

Instantly share code, notes, and snippets.

Andy Perdana Geruhn

Block or report user

Report or block Geruhn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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 / search_shortcut.user.js
Last active Aug 29, 2015
Ctrl + M becomes a shortcut to the search bar of the site.
View search_shortcut.user.js
// ==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
@Geruhn
Geruhn / .bash_aliases
Created Dec 12, 2013
git init && add && commit
View .bash_aliases
alias "giac"="git init && git add . && git commit -m \"Initial commit\""
@Geruhn
Geruhn / Default (Windows).sublime-keymap
Last active Dec 29, 2015
Sublime: Keybinding for [1,1][0,1] cells layout (one big cell in the left column, two halves in the right column) Example: http://twitpic.com/dmrbv8
View Default (Windows).sublime-keymap
{
"keys": ["alt+shift+6"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.45, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells":
[
[0, 0, 1, 2], [1, 0, 2, 1],
@Geruhn
Geruhn / addAnimationListener.js
Created Nov 26, 2013
JavaScript: addAnimationListener (addEventListener on Animations with vendorprefixes)
View addAnimationListener.js
EventTarget.prototype.addAnimationListener = function(type, listener, useCapture, wantsUntrusted) {
//vendors[0][vendorIndex] = vendor-prefixes + vendors[1][vendorIndex] = vendorwrittenInCamelCase
//[[w3c, ff, webkit, Opera, IE],[...]]
var vendors = [['', '', 'webkit', 'o', 'MS'],[false, false, true, false, true]];
var prefix = 'Animation';
var animationTypes = ['Start', 'Iteration', 'End'];
var animationType = false;
for(var i = animationTypes.length - 1; (i >= 0) && !animationType; i--) {
animationType = (type.toLowerCase() === animationTypes[i].toLowerCase()) ? i : false;
}
@Geruhn
Geruhn / add_remove_toggle_Many.js
Created Nov 25, 2013
JavaScript: (add|remove|toggle)Many
View add_remove_toggle_Many.js
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--) {
@Geruhn
Geruhn / addGlobalStyle.js
Created Nov 25, 2013
JavaScript: addGlobalStyle(css)
View addGlobalStyle.js
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
@Geruhn
Geruhn / Responsive_Twitter.css
Last active Dec 28, 2015
Making Twitter responsive with a greasemonkey script
View Responsive_Twitter.css
@media (min-width: 701px) {
.dashboard {
position: fixed;
}
}
@media (max-width: 900px) and (min-width: 701px) {
.wrapper {
width: 100%;
padding: 54px 0px 0px 0px;
View gist:6389735
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;
};
You can’t perform that action at this time.