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/zsh | |
echo 'Commencing Feierabend' | |
git stash | |
git switch main | |
git stash pop | |
git commit -a -m 'Feierabend' | |
git push --force origin main | |
/usr/bin/expect -c "spawn fab production deploy; expect 'out: sudo password:'; send 'dieRuthbacktsogut';" | |
echo 'Feierabend accomplished' |
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 code should solve any Sudoku | |
# 1. The algorithm first tries direct decidable fields (with only one possible value) | |
# 2. If there are only fields left with multiple possible values, it will make a recursive call with each possible value | |
# 3. PROFIT! | |
import copy | |
# solveable | |
grid = [[3,0,0, 2,4,0, 0,6,0], | |
[0,4,0, 0,0,0, 0,5,3], |
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
<!-- | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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 re | |
def markdown_to_bbcode(s): | |
links = {} | |
codes = [] | |
def gather_link(m): | |
links[m.group(1)]=m.group(2); return "" | |
def replace_link(m): | |
return "[url=%s]%s[/url]" % (links[m.group(2) or m.group(1)], m.group(1)) | |
def gather_code(m): |
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
from os.path import splitext | |
from django.core.exceptions import ValidationError | |
from django.utils.translation import ugettext_lazy as _ | |
from django.template.defaultfilters import filesizeformat | |
class FileValidator(object): | |
""" | |
Validator for files, checking the size, extension and mimetype. |
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
from flask import Module, request, redirect, url_for, render_template, abort | |
from formalchemy import FieldSet | |
from example import db | |
from example import Service, User, Forum, Category, Topic, Post | |
mod = Module(__name__) | |
models = { |