Skip to content

Instantly share code, notes, and snippets.

@pgampe
pgampe / offlineimap_dot_slash.py
Last active Feb 14, 2017
Migrate offlineimap separator from point to slash by moving all folders
View offlineimap_dot_slash.py
import os
os.chdir('/path/to/your/local/copy/here')
dirs = os.listdir()
dirs.sort(key=len, reverse=True)
i = 0
for org_dir in dirs:
if '.' not in org_dir:
@pgampe
pgampe / twrp.sh
Last active Nov 13, 2016 — forked from inhies/twrp.sh
Creates TWRP compatible backups over USB using ADB without any files ever touching your SD card.
View twrp.sh
#!/bin/bash
#
# Version 1.4
#
# twrp.sh -- a TWRP compatible backup script for your computer
# Brought to you by inhies
#
# This script creates TWRP compatible backups over usb using adb and magikz
# By default it makes a folder in the standard TWRP date--time format (I think)
# To restore these backups, place the folder in /sdcard/TWRP/BACKUPS/<serialnumber>/
@pgampe
pgampe / 0_notes.md
Last active Apr 20, 2016
TYPO3 Acceptance tests
View 0_notes.md

Make sure to know your path the the PHP 7 cli executable. Mine is /usr/local/bin/php You will need to adopt the prepare scripts accordingly!

Call in this order:

  • test-prepare.sh
  • test-phantomjs.sh
  • test-firefox.sh
  • test-stop.sh
@pgampe
pgampe / test_cert.php
Last active Apr 8, 2016
Test TLS Support by PHP
View test_cert.php
<?php
error_reporting(E_ALL);
echo '<html><head><title>Test cURL with TLS</title></head><body><pre>';
$fp = fopen("/dev/null", "w");
$output = fopen('php://output', 'rw');
$ch = curl_init();
@pgampe
pgampe / menu.ts
Last active Aug 4, 2020
Fully cached menu with TypoScript
View menu.ts
page.10 >
page.10 = COA
page.10 {
cache {
key = main-menu
}
10 = TEXT
10 {
View patches-by-author-since-45.sh
#!/bin/bash
AUTHOR="$1"
MKTEMP=$(which mktemp)
if [[ -n $MKTEMP ]]; then
TEMP1=$($MKTEMP)
TEMP2=$($MKTEMP)
else
TEMP1="/tmp/$(basename $0).$$.tmp"
@pgampe
pgampe / test.php
Created Nov 23, 2013
is_null($var) vs $var === NULL testing
View test.php
<?php
$varNull = NULL;
$varNotNull = 0;
$i = 0;
$start = microtime(TRUE);
for ($i = 0; $i === 10000000; $i++) {
if (is_null($varNull)) {
View composer
$ composer.phar show -i
composer/installers dev-master d792632 A multi-framework Composer library installer
doctrine/annotations v1.1.2 Docblock Annotations Parser
doctrine/cache v1.3.0 Caching library offering an object-oriented API for many cache back...
doctrine/collections dev-master bcb5377 Collections Abstraction library
doctrine/common 2.4.x-dev c94d6ff Common Library for Doctrine projects
doctrine/dbal 2.3.x-dev 59c310b Database Abstraction Layer
doctrine/inflector dev-master 8b4b3cc Common String Manipulations with regard to casing and singular/plur...
doctrine/lexer dev-master bc0e1f0 Base library for a lexer that can be used in Top-Down, Recursive De...
doctrine/migrations dev-master 90f5c39 Database Schema migrations using Doctrine DBAL
@pgampe
pgampe / .gource
Created Aug 9, 2013
Render videos of a git repository. This is my config for TYPO3 CMS 4.6. The perl script for fetching the avatar images might be broken. It is not really needed. And it does store all images as PNG files, but some of them are JPEGs...
View .gource
[display]
#fullscreen=true
#viewport=1680x1050
viewport=1280x720
[gource]
camera-mode=overview
colour-images=true
file-idle-time=5
hide=filenames,dirnames,mouse,progress,date
@pgampe
pgampe / composer.json
Created Jul 27, 2013
Neos composer on fedora
View composer.json
{
"name": "typo3/neos-base-distribution",
"description" : "TYPO3 Neos Base Distribution",
"license": "GPL-3.0+",
"config": {
"vendor-dir": "Packages/Libraries",
"bin-dir": "bin"
},
"require": {
"typo3/neos": "dev-master",