This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function list-package-sizes () { | |
if [ $1 ]; then | |
case $1 in | |
-h|--help) | |
local errno=0 | |
;; | |
*) | |
local errno=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generates a string in the form of an array-declaration and puts it into declare -A | |
declare -A exit_status=$(echo -n "( \ | |
[output]=\"" ; cat /no/such/file 2>&1 ; echo -en "\" | |
[errno]=$? | |
)") | |
# to test it: | |
echo error ${exit_status[errno]}: ${exit_status[output]} >/dev/stderr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changeColor () { | |
## Usage | |
local help_message="\ | |
Usage: | |
changeColor ((fg|bg|light|light-bg)? color (bold|dim|underlined|inverted)*)+ | |
Example: | |
changeColor fg red light-bg green underlined bold" | |
#/> | |
## local properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ssh_no_memory() { | |
command ssh $* | |
echo -n "Remove " | |
tail -1 $HOME/.ssh/known_hosts | cut -d' ' -f1 | tr -d '\n' | |
echo " from known hosts?" | |
read yesno | |
case $yesno in | |
Y|y|Yes|yes|YES|Nagut|Jo|Jepp|Jadoch|klar) | |
sed -i '$ d' $HOME/.ssh/known_hosts | |
;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-pages/core-pages.html"> | |
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import logging | |
def float_to_bin(x): | |
p = 0 | |
while ((2 ** p) * x) % 1 != 0: | |
logging.info('Remainder = %s' % ((2 ** p) * x - int((2 ** p) * x))) | |
p += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Create dynamic bg.svg in /tmp. | |
[Service] | |
User=nobody | |
Group=nobody | |
ExecStart=/usr/local/bin/dynbg.py /usr/local/etc/dynbg.svg /tmp/bg.svg | |
Restart=no | |
Type=oneshot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# maybe.py - a Pythonic implementation of the Maybe monad | |
# Copyright (C) 2014. Milan Oberkirch <[email protected]> | |
# Copyright (C) 2014. Senko Rasic <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#-*- coding:utf-8 -*- | |
import imaplib | |
import getpass | |
import argparse | |
argparser = argparse.ArgumentParser(description="Dump a IMAP folder into .eml files") | |
argparser.add_argument('-s', dest='host', help="IMAP host, like imap.gmail.com", required=True) | |
argparser.add_argument('-u', dest='username', help="IMAP username", required=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#5b9aa9, 6.5%)", | |
"@brand-success": "#889a3a", |
OlderNewer