Skip to content

Instantly share code, notes, and snippets.

View zopieux's full-sized avatar

Alexandre Macabies zopieux

View GitHub Profile
@zopieux
zopieux / conkyrc
Created May 10, 2015 14:48
conky for py3status
out_to_x no
own_window no
out_to_console yes
background no
max_text_width 0
# Update interval in seconds
update_interval 2.0
# This is the number of times Conky will update before quitting.
@zopieux
zopieux / PKGBUILD.patch
Created June 20, 2015 16:59
AUR lua-cjson PKGBUILD patch
--- a/PKGBUILD 2013-06-01 18:03:30.000000000 +0200
+++ b/PKGBUILD 2015-06-20 18:57:39.046300329 +0200
@@ -2,7 +2,7 @@
pkgname=lua-cjson
pkgver=2.1.0
-pkgrel=2
+pkgrel=3
pkgdesc="A fast JSON parsing and encoding support for Lua."
arch=(i686 x86_64)
@zopieux
zopieux / eirb-cas.php
Created September 17, 2015 14:38
eirb CAS Eirbware
<?php
require_once 'eirb-common/CAS/CAS.php';
function eirb_cas_protect() {
phpCAS::client(CAS_VERSION_2_0, 'cas.enseirb-matmeca.fr', 443, 'cas');
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
return phpCAS::getUser();
}
# -*- coding: utf-8 -*-
import smtplib
from email.mime.text import MIMEText
from email.header import Header
import urllib.request as urllib
from bs4 import BeautifulSoup
from random import choice
def randomWikipediaPage():
@zopieux
zopieux / main.py
Created July 25, 2015 14:33
IRC to Voxygen TTS
import asyncio
import binascii
import irc3
import re
import requests
import subprocess
import time
VOICES = ["Helene", "Emma", "Electra", "DarkVadoor", "Damien", "Agnes", "Bicool", "Chut", "Melodine", "Ludovic", "Fabienne", "Eva", "Loic", "JeanJean", "John", "Matteo", "Michel", "Papi", "Philippe", "Ramboo", "Robot", "Sidoo", "Sorciere", "Yeti", "Zozo"]
@zopieux
zopieux / sample.sh
Created May 10, 2016 22:35
WordReference pseudo-TTS
python wordreferencespeak.py \
never gonna give you up \
never gonna let you down \
never gonna run around and desert you
@zopieux
zopieux / toggle-vga-hdmi.sh
Created May 27, 2016 20:40
Laptop screen & (VGA | HDMI) toggle
#!/bin/sh
main=LVDS1
a=VGA1
b=HDMI1
dir=left
function on {
echo Switching $1 on
xrandr --output $1 --auto --$dir-of $main
@zopieux
zopieux / i3-config
Last active November 22, 2016 15:59
Dependencies: i3-wm, bash, xrandr, curl, feh, imagemagick (convert), python & python-requests
# random wallpaper
set $random-wall-cmd /bin/sh $HOME/.config/i3/wallpaper.sh
exec --no-startup-id $random-wall-cmd
bindsym $mod+b exec --no-startup-id $random-wall-cmd
@zopieux
zopieux / test-all-problems.py
Last active January 23, 2017 22:56
[prologin] Test all problems on camisole
import django
django.setup()
from problems.models import Challenge
from prologin.languages import Language
import requests
from pathlib import Path
def get_in_out(p, tests, name):
refs = Path(p.file_path()).rglob('ref.*')
@zopieux
zopieux / logging_refactor.py
Last active April 26, 2017 23:35
logging.* auto refactoring
import ast
import copy
from pathlib import Path
import asttokens
import astunparse
import string
LOGGING_METHODS = {'debug', 'info', 'warn', 'warning', 'exception', 'error', 'fatal', 'critical'}