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
try: | |
# this is what fails here | |
context['children'] = mark_safe(u''.join(parts)) | |
except: | |
import code | |
import readline | |
import rlcompleter | |
vars = globals() | |
vars.update(locals()) | |
readline.set_completer(rlcompleter.Completer(vars).complete) |
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 bash | |
RETCODE=1 | |
# Change the URL in the curl commandline for yourself. | |
while [[ $RETCODE == 1 ]]; do | |
echo -n "$RANDOM ... " | |
OUT=$(curl -gs "https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=121598&dienstleisterlist=122210,122217,122219,122227,122231,122238,122243,122252,122260,122262,122254,122271,122273,122277,122280,122282,122284,122285,122286,122296,150230,122301,122297,122294,122312,122314,122304,122311,122309,317869,324433,325341,324434,122281,122276,122274,122267,122246,122251,122257,122208,122226,121646&herkunft=http%3A%2F%2Fservice.berlin.de%2Fdienstleistung%2F121598%2F&asd=$RANDOM"|grep '"buchbar'|head -1|grep 'datum=2015-10') | |
RETCODE=$? |
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 bash | |
# Turns your smartplug on and off. Set the IP and the password in the variables below. | |
# Works with SP-1101w and SP-2101W plugs. | |
# http://www.edimax.com/images/Image/manual/HomeAutomation/SP-1101W/SP-1101W_manual.pdf | |
EDIMAX_IP='192.168.1.141' | |
EDIMAX_PASSWORD='password' | |
STATE='ON' |
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
extension "txt" | |
# Path: /usr/local/share/source-highlight/ | |
styletemplate "\x1b[$stylem$text\x1b[m" | |
color "00;38;05;$style" | |
colormap | |
"blue" "75" | |
"darkblue" "33" |
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
# Path to Oh My Fish install. | |
set -q XDG_DATA_HOME | |
and set -gx OMF_PATH "$XDG_DATA_HOME/omf" | |
or set -gx OMF_PATH "$HOME/.local/share/omf" | |
# Customize Oh My Fish configuration path. | |
#set -gx OMF_CONFIG /Users/laszlokarolyi/.config/omf | |
# Reload user_abbreviations by executing: | |
. ~/.config/fish/abbreviations/fish_user_abbreviations.fish |
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 bash | |
# http://papers.ch/speeding-up-your-mac-osx-terminal-input/ | |
#echo "Disable press-and-hold for keys in favor of key repeat" | |
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false | |
echo "Set a blazingly fast keyboard repeat rate" | |
defaults write NSGlobalDomain KeyRepeat -int 0.02 |
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
# We have a Django `Updates` model with `product`, `date`, `version` fields. | |
# We want to fetch the newest versions of products without executing many queries, in a Django way. | |
from django.db.models import CharField, Value as V | |
from django.db.models.functions import Concat | |
a = Updates.objects.values('product_id').annotate(cc=Concat('product_id', V('-'), Max('date'), output_field=CharField())).values('cc') | |
b = Updates.objects.annotate(cc=Concat('product_id', V('-'), 'date', output_field=CharField())).filter(cc__in=a) |
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 sh | |
# Packages necessary on ubuntu: python3-pip | |
USED_PYTHON_BINARY="python3.7" | |
set -x | |
# Install/update basic package handling tools | |
$USED_PYTHON_BINARY -m pip install --user -U pip wheel setuptools |
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
### Keybase proof | |
I hereby claim: | |
* I am karolyi on github. | |
* I am karolyi (https://keybase.io/karolyi) on keybase. | |
* I have a public key whose fingerprint is D0CC 28D1 8E86 673E C579 0034 372A A22D 38BD 5B13 | |
To claim this, I am signing this object: |
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
{ | |
"workbench.colorTheme": "Monokai", | |
"editor.fontFamily": "'Roboto Mono Light', 'Courier New', monospace, 'Droid Sans Fallback'", | |
"editor.fontSize": 18, | |
"editor.wordWrap": "bounded", | |
"editor.rulers": [ | |
72, 79 | |
], | |
"files.autoSave": "onFocusChange", | |
"editor.renderWhitespace": "all", |
OlderNewer