Skip to content

Instantly share code, notes, and snippets.

View hbsdev's full-sized avatar

hbsdev hbsdev

View GitHub Profile
@hbsdev
hbsdev / Verbinde Laufwerk K.cmd
Created October 29, 2023 12:21
Connect drive K on startup
REM Save to "C:\Users\WINDOWS_USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
REM Filename: "Verbinde Laufwerk K.cmd"
net use k: /delete /y
net use k: \\192.168.1.214\starmoney10 /persistent:no
@hbsdev
hbsdev / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
def context(conf, retry = None, fake_error = None):
"""
Examples:
- Do not fail unless the third try goes also wrong: retries = 3
- wait delay_ms between eacht try
- Succeed on the 3rd try: fails=2
retry = dict(retries=2, delay_ms=1)
fake_error = dict(fails=3)
ctx = swapi.context(conf)
@hbsdev
hbsdev / clean_py.sh
Last active July 14, 2024 19:48 — forked from joelverhagen/clean_py.sh
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@hbsdev
hbsdev / shopware-nginx.sh
Created April 21, 2015 15:57
shopware-nginx.md
# https://hostianer.de/shopware-hosting-mit-nginx/
client_max_body_size 100M;
location ~ /(engine|images/[a-z]+|files|templates)/ {
}
location / {
index index.html index.php shopware.php;
rewrite shopware.dll /shopware.php;
rewrite files/documents/.* /engine last;
rewrite images/ayww/(.*) /images/banner/$1 last;
@hbsdev
hbsdev / safaribooks-2015-04-06.css
Last active August 29, 2015 14:18
Safari Books CSS - improve contrast by making the orange text darker - see https://userstyles.org/styles/112282/safari-books-improve-contrast
@charset UTF-8;
/*!normalize.css v2.0.1 | MIT License | git.io/normalize */
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary {
display:block;
}
audio,canvas,video {
display:inline-block;
}

Here's a few things I tried to write output to a python subprocess pipe.

from subprocess import Popen, PIPE

p = Popen('less', stdin=PIPE)
for x in xrange(100):
    p.communicate('Line number %d.\n' % x)
@hbsdev
hbsdev / .zshrc
Last active August 29, 2015 14:03
.zshrc file by Matther Blisset
# .zshrc file written by Matthew Blissett.
#
# Latest version available from http://matt.blissett.me.uk/linux/zsh/zshrc
#
# Some functions taken from various web sites/mailing lists, others written
# myself.
#
# Last updated 2014-04-16
# Released into the public domain.
#