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
# LibreOffice macro script | |
import uno | |
def changeFontsWithin(object_list, to_font, to_weight=None): | |
for i in range(object_list.getCount()): | |
shape = object_list.getByIndex(i) | |
the_type = shape.getShapeType() | |
assert(shape.supportsService(the_type)) | |
if shape.supportsService('com.sun.star.drawing.TextProperties'): | |
if to_font: |
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 | |
# Inspired by https://nf-co.re/stats#github_prs | |
# Original code by Phil Ewens, cf. https://github.com/nf-core/nf-co.re/issues/190 | |
# This code is under MIT License, as the original nf-co.re website is | |
# INSTALL: pip install jinja2 livereload requests xreload | |
# USAGE: ./build_stats_page.py [--use-dump] [--watch-and-serve] org/repo | |
import argparse, json, os, sys, types, webbrowser |
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 import sqlite3, sys | |
from collections import namedtuple | |
Comment = namedtuple('_Comment', ('id', 'text', 'author', 'uri')) | |
QUERY = 'SELECT comments.id, text, author, uri FROM comments INNER JOIN threads on comments.tid = threads.id' | |
last_comment_id_filepath = sys.argv[1] | |
isso_db_filepath = sys.argv[2] | |
uri_prefix = sys.argv[3] if len(sys.argv) == 4 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
#!/usr/bin/env python | |
# USAGE: ./nginx_redirect_generator.py /lucas/blog < ghost_export.json | |
import datetime, json, os, sys | |
path_prefix = sys.argv[1] | |
ghost_db = json.loads(sys.stdin.read()) | |
posts = ghost_db['db'][0]['data']['posts'] |
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 | |
# USAGE: ./webpage_modification_notifier.sh $URL | |
set -o pipefail -o errexit -o nounset | |
date | |
cd $(dirname "${BASH_SOURCE[0]}") | |
url="${1?'Argument required'}" | |
echo $url | |
last_version=${url//[^[:alpha:]]/}.html |
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 python | |
import json | |
import os | |
import sys | |
import datetime | |
with open("old.json", "r") as f: | |
raw = f.read() |
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 python | |
# USAGE: ./convert_report_to_cucumber_format.py --behave-report bdd/report.json [--json-schema cucumber-report-schema.json] | |
import argparse, json, sys | |
from jsonschema import Draft4Validator | |
def main(argv=None): | |
args = parse_args(argv) |
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
--- index.txt 2015-08-24 22:48:41.587933500 +0200 | |
+++ index.txt.new 2015-08-24 22:41:03.269527000 +0200 | |
@@ -381,6 +381,20 @@ | |
print(myserver.tail("/var/log/dumb_daemon.log", n=100)) | |
+.. _special_arguments_defaults: | |
+ | |
+Special arguments defaults | |
+-------------------------- |