This file contains 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 | |
# License: WTFPL | |
import subprocess | |
status = subprocess.check_output(["nmcli", "networking", "connectivity"]).decode() | |
# replace "vollständig" with whatever nmcli outputs for "full" in your language setting | |
if status == "vollständig\n": | |
icon = "<span color='green'><tt>✓</tt></span>" | |
else: |
This file contains 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
import random | |
print("Willkommen beim Zahlenraten!") | |
untergrenze = input("Gib die Untergrenze ein: ") | |
obergrenze = input("Gib die Obergrenze ein: ") | |
# input liefert strings. Wir brauchen integers. Also umwandeln | |
untergrenze = int(untergrenze) | |
obergrenze = int(obergrenze) |
This file contains 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
def plus(zahl1, zahl2): | |
"""" | |
Addiert zwei Zahlen. | |
""" | |
ergebnis = int(zahl1) + int(zahl2) | |
return ergebnis | |
def minus(zahl1, zahl2): | |
"""" | |
Substrahiert die zweite Zahl von der ersten Zahl. |
This file contains 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
*~ |
This file contains 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
# Geany's snippets configuration file | |
# | |
# use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR). | |
# use \t or %ws% for an indentation step, it will be replaced according to the current document's indent mode. | |
# use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue'). | |
# use %key% for all keys defined in the [Special] section. | |
# use %cursor% to define where the cursor should be placed after completion. You can define multiple | |
# %cursor% wildcards and use the "Move cursor in snippet" to jump to the next defined cursor | |
# position in the completed snippet. | |
# You can define a section for each supported filetype to overwrite default settings, the section |
This file contains 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 | |
#Cut extension off | |
FILENAME=`echo $1 | cut -d'.' -f1` | |
#Put [$FILENAME][S. ] before everything in double quotes | |
sed -i 's|\(\".*\"\)|['$FILENAME'][S. ]\1|g' $1 |
This file contains 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 detect( fn, err){ | |
var flag = true; | |
setTimeout(function(){ | |
if(flag) err(); | |
},0); | |
fn(); | |
flag = false; | |
} | |
// example with error |