Skip to content

Instantly share code, notes, and snippets.

"""Add currencies
Revision ID: 927ed575acbd
Revises: cb038f79982e
Create Date: 2020-04-25 14:49:41.136602
"""
# revision identifiers, used by Alembic.
revision = "927ed575acbd"
@Glandos
Glandos / dataclasses_json_key_function.py
Created July 1, 2019 11:06
Convert JSON dataclasses field to CamelCase
#!/usr/bin/env python3
import types
import dataclasses
from dataclasses import dataclass, field, Field, MISSING
from dataclasses_json import dataclass_json
from marshmallow import fields
from camel_case_switcher import underscoreToCamelCase
public class TestRecursion {
public class TestRecursion0 {
public class TestRecursion1 {
public class TestRecursion2 {
public class TestRecursion3 {
public class TestRecursion4 {
public class TestRecursion5 {
public class TestRecursion6 {
public class TestRecursion7 {
public class TestRecursion8 {
@Glandos
Glandos / precompresscssjswebfont.sh
Last active May 17, 2016 14:10 — forked from magnetikonline/precompresscssjswebfont.sh
Recursively pre-compress (gzip) CSS/JavaScript/webfont assets for use Nginx and the HttpGzipStaticModule module.
#!/bin/bash -e
# note: this won't work too well with filenames/directories with spaces in them
#COMPRESS_BIN="gzip -c9 -k"
COMPRESS_BIN="ls >/dev/null"
ROOT_DIR=/var/www
COMPRESSED_EXT="css|js|eot|svg|ttf|woff"
SKIPPED_EXT="src\.css|src\.js"
MIN_SIZE="-size +10k"
// ==UserScript==
// @name Boursorama - No Virtual Keyboard
// @namespace org.bouil
// @author bouil
// @author glandos
// @copyright 2013-2016, https://github.com/bouil/userscripts
// @description Remove virtual keyboard and add a classic input text field for the password on Boursorama website https://clients.boursorama.com/connexion/. NOT compatible with Chrome yet.
// @include https://clients.boursorama.com/connexion/?clean=1
// @include http://localhost:63342/userscripts/tests/boursorama/Connexion.html
// @version 0.3
@Glandos
Glandos / Log
Last active August 29, 2015 14:25
# uwsgi --ini /etc/uwsgi/vassals/graphite-api.ini --include /etc/uwsgi/vassals/templates/fixed.ini
[uWSGI] getting INI configuration from /etc/uwsgi/vassals/graphite-api.ini
[uWSGI] getting INI configuration from /etc/uwsgi/vassals/templates/python3.ini
[uWSGI] getting INI configuration from /etc/uwsgi/vassals/templates//base.ini
[uWSGI] getting INI configuration from /etc/uwsgi/vassals/templates/fixed.ini
Begin graphite with _graphite:_graphite
Begin python3 with _graphite:_graphite
Begin base with _graphite:_graphite
After base with _graphite:_graphite
After python3 with _graphite:_graphite
@Glandos
Glandos / gist:7cd53ce90d3cce153f64
Created July 17, 2014 13:55
How to crash python and ruby in one shot, using YaST
import ycp
ycp.import_module('NetworkInterfaces')
import threading
def run_background_task(task, *args, **kwargs):
thread = threading.Thread(target=task, args=args, kwargs=kwargs)
thread.setDaemon(True)
thread.start()
return thread
@Glandos
Glandos / gist:7061201
Created October 19, 2013 20:36
avahi-browse -ar with mediacenter
$ avahi-browse -ar
+ eth1 IPv6 C8600084F892@XBMC (mediacenter) AirTunes Remote Audio local
+ eth1 IPv4 C8600084F892@XBMC (mediacenter) AirTunes Remote Audio local
+ eth1 IPv6 XBMC (mediacenter) _xbmc-events._udp local
+ eth1 IPv4 XBMC (mediacenter) _xbmc-events._udp local
+ eth1 IPv6 XBMC (mediacenter) _airplay._tcp local
+ eth1 IPv4 XBMC (mediacenter) _airplay._tcp local
+ eth1 IPv6 XBMC (mediacenter) _xbmc-jsonrpc._tcp local
+ eth1 IPv4 XBMC (mediacenter) _xbmc-jsonrpc._tcp local
+ eth1 IPv6 XBMC (mediacenter) _xbmc-jsonrpc-h._tcp local
@Glandos
Glandos / gist:2349094
Created April 10, 2012 07:40
Test PHP for EXSLT support
<?
$xslt = new XSLTProcessor;
$has_support = $xslt->hasExsltSupport();
echo "XLST has support for EXSLT: "; var_dump($has_support);
?>