Skip to content

Instantly share code, notes, and snippets.

@Pupskuchen
Pupskuchen / pre-commit
Created October 13, 2017 21:55
pre-commit git hook to prevent unwanted direct commits to some branches – to be placed (and chmod +x'ed) in .git/hooks/
#!/usr/bin/env bash
restricted_branches=("develop")
forbidden_branches=("master")
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [[ " ${forbidden_branches[@]} " =~ " ${current_branch} " ]]; then
echo "Direct commits to ${current_branch} are not allowed."
exit 1
@Pupskuchen
Pupskuchen / index.php
Created May 6, 2016 18:28
a simple and basic php script to create a directory index of the configured directory
<?php
$conf = array(
// specify the url under which this directory listing runs
'url' => 'http://localhost/dirindex',
// specify the directory that should be listed (relative to this script)
'path' => '.',
// if true, files beginning with a dot (.) will be shown, false hides them
'showHidden' => false,
// page title
'title' => 'directory index',
@Pupskuchen
Pupskuchen / ability
Last active August 29, 2015 14:23
gives you the ability to show all active abilities in your lane
document.getElementById('activitylog').removeAttribute('style');
var styles = document.createElement('style');
styles.type = 'text/css';
styles.textContent = '#activeinlanecontainer:hover {height:auto;background:rgba(50,50,50,0.9);padding-bottom:10px;position:absolute;z-index:1} #activeinlanecontainer:hover + #activitylog {margin-top:97px} #activitylog {margin-top: 29px}';
document.getElementsByTagName('head')[0].appendChild(styles);