Skip to content

Instantly share code, notes, and snippets.

@darookee
darookee / rooFloatHeader.js
Created August 10, 2015 21:18
clone <header/> and pop in from above when the original touches the top of the viewport
;(function(){
function addEvent(evnt, elem, func) {
if (elem.addEventListener) // W3C DOM
elem.addEventListener(evnt,func,false);
else if (elem.attachEvent) { // IE DOM
elem.attachEvent("on"+evnt, func);
}
else { // No much to do
elem[evnt] = func;
}
@darookee
darookee / systemd.services.sh
Created May 17, 2015 11:53
SystemD Replacement for "service --status-all"
#!/bin/bash
# https://www.reddit.com/r/commandline/comments/35zs03/systemd_replacement_for_service_statusall/cr9f13q
for t in $(systemctl --type help | grep -v "^Available"); do
echo -e "\n---------- ${t^^} ----------"
systemctl --all --no-pager --type="$t" --show-types
done
@darookee
darookee / i3lock.sh
Created April 21, 2015 10:02
i3lock script
#!/bin/bash
#depends on: imagemagick, i3lock, scrot
#https://www.reddit.com/r/unixporn/comments/3358vu/i3lock_unixpornworthy_lock_screen/cqilnv3
IMAGE=/tmp/lockscreen.png
TEXT=/tmp/locktext.png
ICON=/home/badel/Pictures/Icons/Lock-icon.png
scrot $IMAGE

Keybase proof

I hereby claim:

  • I am darookee on github.
  • I am darookee (https://keybase.io/darookee) on keybase.
  • I have a public key whose fingerprint is E64E 8617 8CA3 A555 077A 970F 8E36 2C10 85D5 2CBA

To claim this, I am signing this object:

@darookee
darookee / autobeet
Created March 4, 2015 12:12
Export Music from your beets-library and convert id3v2.4 to v2.3 for older car stereos
#!/bin/sh
export carmusicdir=~/automusik/
subpath()
{
echo "$1" | rev | cut -d"/" -f1-$2 | rev
}
case "$1" in
@darookee
darookee / UmlLinkCommand.php
Created March 4, 2015 12:10
Get Link to display Doctrine-Relations as UML - Symfony-Command
<?php
namespace R\UmlBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
fg
zle redisplay
else
zle push-input
zle clear-screen
fi
}
zle -N fancy-ctrl-z
@darookee
darookee / _archive
Created February 12, 2015 14:25
archive folders with bz2 to $archivedir
#compdef archive
_archive() {
actions=(
'ls:list archives or contents'
'rm:remove from achive'
'add:add folder to archive',
'restore:restore files from archive'
'stats:show archive stats'
)
@darookee
darookee / config.h
Created February 7, 2015 21:20
st with zenburn colors
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
static int borderpx = 2;
static int histsize = 2000;
@darookee
darookee / index.html
Created October 28, 2014 19:25
minimal html page
<html>
<head>
<title>This is the Page-Title</title>
</head>
<body>
<img src="/web/path/to/image.jpg" alt="image-title" />
</body>
</html>