Skip to content

Instantly share code, notes, and snippets.

View smalot's full-sized avatar

Sebastien MALOT smalot

View GitHub Profile
@reusee
reusee / py2php.py
Created June 20, 2011 16:49
Python to php translator, compile python script to php
import ast
from cStringIO import StringIO
import sys
INFSTR = '1e308'
def interleave(inter, f, seq):
seq = iter(seq)
try:
f(next(seq))
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@kyleondata
kyleondata / gist:3440492
Last active February 1, 2023 19:23
Backbone.js and Handlebars.js example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<script src="jquery-1.7.2.min.js" ></script>
<script src="handlebars-1.0.0.beta.6.js" ></script>
<script src="underscore-min.js" ></script>
<script src="backbone-min.js" ></script>
@JosefJezek
JosefJezek / how-to-ntlm-with-apache.md
Last active July 27, 2021 02:42
How to NTLM with Apache
<?php
/**
* This script allows to redirect mail sent via the php mail function
* to a dedicated mailbox
*
* @date 2013-06-20
* @author Sébastien MALOT / Actualys
*
* ----------------------------------
@jpetazzo
jpetazzo / gist:6127116
Created July 31, 2013 23:21
Debian/Ubuntu containers protips, thanks to @spahl
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
@smalot
smalot / PdfParser.php
Last active January 6, 2025 20:04
Use this static class to extract Text from Pdf files. It supports compressed and uncompressed Pdf (version 1.1 to 1.7) : tested It supports octal encoded (eg : \050) content, but not hexadecimal (eg : <005E>). In some cases, it works better than "pdftotext" binary tool.
<?php
/**
* @file
* Class PdfParser
*
* @author : Sebastien MALOT <[email protected]>
* @date : 2013-08-08
*
* References :
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@ptasker
ptasker / gist:7680134
Last active August 4, 2017 08:30
Swiftmailer create attachment
<?php
//Using composer to get the Sabre lib
require dirname ( __FILE__ ) . '/../vendor/autoload.php';
use Sabre\VObject\Component\VCalendar;
// Create a message
$message = Swift_Message::newInstance ( 'Message Title' )
->setFrom ( array( '[email protected] ' => 'John Doe' ) )
->setTo ( array( $email ) )
->setSubject ( "Cool message subject" )
@FeroVolar
FeroVolar / redmine
Created December 11, 2013 14:32
Redmine init.d script for Debian
#!/bin/bash
### BEGIN INIT INFO
# Provides: redmine
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redmine webrick
# Description: redmine webrick server autostart-script
### END INIT INFO