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/python3 | |
# -*- coding: utf-8 -*- | |
# Copyright © 2015 Martin Ueding <dev@martin-ueding.de> | |
# Licensed under The MIT License | |
import argparse | |
def main(): | |
options = _parse_args() |
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
// Copyright © 2014 Martin Ueding <dev@martin-ueding.de> | |
#include <iostream> | |
#include <regex> | |
int main() { | |
std::string haystack {"This\nhas\nnewlines."}; | |
std::regex regex {"\n"}; | |
std::string replacement {"\n# "}; | |
std::string result {std::regex_replace(haystack, regex, replacement)}; |
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/python3 | |
# -*- coding: utf-8 -*- | |
# Copyright © 2013-2014 Martin Ueding <dev@martin-ueding.de> | |
# Licensed under The GNU Public License Version 2 (or later) | |
import argparse | |
import re | |
import shutil |
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
class Colorcodes(object): | |
""" | |
Provides ANSI terminal color codes which are gathered via the ``tput`` | |
utility. That way, they are portable. If there occurs any error with | |
``tput``, all codes are initialized as an empty string. | |
The provides fields are listed below. | |
Control: |
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 | |
# This script is in the public domain. | |
# Based on an idea by Fabien Udriot | |
# see http://pastie.org/4225971 | |
# Enter your username for typo3.org here. If no username is entered here, you | |
# will be promted for it during execution. | |
username="" |
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/python | |
# -*- coding: utf-8 -*- | |
# Copyright (c) 2012 Martin Ueding <dev@martin-ueding.de> | |
""" | |
Based on a Question from "Physics - Stack Exchange". | |
http://physics.stackexchange.com/questions/20083/riddle-about-speed | |
""" |
NewerOlder