Skip to content

Instantly share code, notes, and snippets.

View gsdefender's full-sized avatar
💭
I may be slow to respond.

Emanuele Cipolla gsdefender

💭
I may be slow to respond.
View GitHub Profile
@gsdefender
gsdefender / image.py
Created June 5, 2017 12:53
Backport of image module from current Keras for use with older releases; includes a ImageDataGenerator that can be used with autoencoders
"""Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
"""
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import re
from scipy import linalg
@gsdefender
gsdefender / mc.ext
Last active April 10, 2017 15:27
View xlsx file with Midnight Commander
# Add this to your mc.ext user file, search for
# Microsoft Excel Worksheet and _prepend_ this rule to the existing one.
regex/i/\.xlsx$
Open=/usr/lib/mc/ext.d/doc.sh open msxls
View=%view{ascii} /usr/local/bin/xlsx2csv %f
# Please note that if you do not prepend this block to the existing block for xls/xlsw, its regexp
# will catch the xlsx and so xlsx2csv will not be called
# Be sure to keep the existing viewer directives, as in this example:
# Microsoft Excel Worksheet
@gsdefender
gsdefender / stop_words.php
Last active September 28, 2016 13:00 — forked from brianteachman/stop_words.php
A function that returns a PHP array of common English and Italian stop words.
<?php
//http://www.ranks.nl/stopwords/(language)
function stop_words($lang)
{
$stop_words = array("it_IT" => array("a",
"adesso",
"ai",
"al",
"alla",
"allo",
@gsdefender
gsdefender / fuck-openldap.sh
Created August 23, 2016 15:56 — forked from jaseg/README.md
Convert openldap .schema files to .ldif files
#!/usr/bin/env bash
# convert OpenLDAP schema file to LDIF file
#
# Copyright 2012 NDE Netzdesign und -entwicklung AG, Hamburg
# Written by Jens-U. Mozdzen <jmozdzen@nde.ag>
# Copyright 2014 jaseg <github@jaseg.net>
#
# Permission is granted to use, modify and redistribute this file as long as
# - this copyright notice is left unmodified and included in the final code
@gsdefender
gsdefender / java-properties.php
Created October 27, 2015 15:02 — forked from alecgorge/java-properties.php
Parse Java properties files in PHP
<?php
function parse_properties($txtProperties) {
$result = array();
$lines = split("\n", $txtProperties);
$key = "";
$isWaitingOtherLine = false;
foreach ($lines as $i => $line) {
if (empty($line) || (!$isWaitingOtherLine && strpos($line, "#") === 0))
continue;
@gsdefender
gsdefender / pacchetti-cygwin.txt
Created July 4, 2015 13:25
Pacchetti Cygwin - Guida HTTP/2
_autorebase,_update-info-dir,adwaita-icon-theme,alternatives,at-spi2-core,autoconf,autoconf2.1,autoconf2.5,automake,automake1.10,automake1.11,automake1.12,automake1.13,automake1.14,automake1.15,automake1.4,automake1.5,automake1.6,automake1.7,automake1.8,automake1.9,base-cygwin,base-files,bash,bash-completion,binutils,bzip2,ca-certificates,cmake,cmake-doc,cmake-gui,compositeproto,coreutils,crypt,csih,cygrunsrv,cygutils,cygwin,cygwin-debuginfo,cygwin-devel,cygwin64-expat,cygwin64-pkg-config,cygwin64-pkg-config-debuginfo,damageproto,dash,dbus,dconf-service,desktop-file-utils,diffutils,dri-drivers,editrights,expat,expat-debuginfo,file,findutils,fixesproto,gamin,gawk,gcc-core,gcc-g++,gccmakedep,gcr,gdb,gdk-pixbuf2.0-svg,getent,gettext,gettext-devel,girepository-Atk1.0,girepository-cairo1.0,girepository-Clutter1.0,girepository-Cogl1.0,girepository-GdkPixbuf2.0,girepository-GLib2.0,girepository-Gst1.0,girepository-Gtk2.0,girepository-Gtk3.0,girepository-GtkClutter1.0,girepository-Json1.0,girepository-Pango1.0,girepo