Skip to content

Instantly share code, notes, and snippets.

@tobiase
tobiase / dj-stripe.sync-command.py
Created October 17, 2019 13:15 — forked from blackboxoperations/dj-stripe.sync-command.py
Sync Command for pending dj-stripe release
import datetime
import json
import multiprocessing
import stripe
import sys
import threading
import time
from pprint import pprint
@tobiase
tobiase / child-app-gitlab.rb
Created July 26, 2019 01:04 — forked from Soulou/child-app-gitlab.rb
Deploy a child app on Scalingo from a Gitlab private repository
#!/usr/bin/env ruby
require 'json'
require 'restclient'
auth_token = ENV["AUTH_TOKEN"]
api_url = ENV["SCALINGO_API_URL"] || "https://api.scalingo.com/v1"
auth_url = ENV["SCALINGO_AUTH_URL"] || "https://auth.scalingo.com/v1"
app = ENV["APP"]
@tobiase
tobiase / .tmux.conf
Created February 23, 2019 01:35 — forked from paulodeleo/.tmux.conf
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
@tobiase
tobiase / responsive_image.py
Created April 25, 2018 23:30 — forked from davecranwell/responsive_image.py
Responsive image tag for Wagtail CMS
from django import template
from django.template import Context
from django.template.base import parse_bits
from wagtail.wagtailimages.templatetags.wagtailimages_tags import ImageNode
from wagtail.wagtailimages.models import Filter, SourceImageIOError, InvalidFilterSpecError
from britishswimming.utils.models import SocialMediaSettings
register = template.Library()
@tobiase
tobiase / README.md
Created March 27, 2018 10:43 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.
@tobiase
tobiase / pyenv_ssl_archlinux.sh
Created March 1, 2018 10:47 — forked from tianchaijz/pyenv_ssl_archlinux.sh
Script to solve python compilation with ssl on Arch Linux
#!/bin/bash
# http://stackoverflow.com/questions/23548188/how-do-i-compile-python-3-4-with-custom-openssl
openssl_version="openssl-1.0.2g"
openssl_package="${openssl_version}.tar.gz"
openssl_home="/opt/$openssl_version"
curl https://www.openssl.org/source/$openssl_package | tar xz && cd $openssl_version && ./config shared --prefix=$openssl_home && make -j8 && sudo make install
export CFLAGS="-I$openssl_home/include"
@tobiase
tobiase / fabfile.py
Created January 23, 2018 18:37 — forked from saevarom/fabfile.py
Fabfile template for Overcast Software
from __future__ import with_statement
from fabric.api import *
from fabric.operations import get
from fabric.contrib.files import exists
from contextlib import contextmanager
import os
env.roledefs = {
'web': ['server1.example.com', 'server2.example.com'],
@tobiase
tobiase / models.py
Last active October 4, 2021 11:08
Prefill wagtailforms with URL parameters
from __future__ import absolute_import, unicode_literals
import django
import django.forms
import wagtail.wagtailforms.models as form_models
from django.db import models
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import (
@tobiase
tobiase / README.md
Created November 3, 2015 01:10 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@tobiase
tobiase / drop_tables.sh
Created October 21, 2015 22:08 — forked from vijinho/drop_tables.sh
drop empty tables
#!/bin/sh
# path settings
MYSQL=`which mysql`
# mysql settings
DB="MYDB"
HOST="127.0.0.1"
USER="root"
PASS="root"