Skip to content

Instantly share code, notes, and snippets.

View JulienBreux's full-sized avatar

Julien Breux JulienBreux

View GitHub Profile
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test page for launching the application via JNLP</title>
</head>
<body>
<h3>Test page for launching the application via JNLP</h3>
<script src="http://java.com/js/deployJava.js"></script>
<script>
deployJava.createWebStartLaunchButton("launch.jnlp")
## Configure
./configure \
--enable-cli \
--prefix=/opt/php54 \
--with-readline \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-pdo-sqlite \
--with-gd \
@JulienBreux
JulienBreux / gist:4510862
Created January 11, 2013 14:00
TRUNCATE / DROP tables DATABASE
TRUNCATE
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done
DROP
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "drop table $table" DATABASE_NAME; done
## Configure
./configure \
--enable-cli \
--prefix=/opt/php53 \
--with-readline \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-pdo-sqlite \
--with-gd \
@JulienBreux
JulienBreux / smalte-migration_03-26-2013.sh
Created March 26, 2013 17:07 — forked from Asenar/gist:5246483
smalte-migration_03-26-2013.sh
mkdir ~/tmp_working_dir
cd ~/tmp_working_dir
git init full_smalte
cd full_smalte
all_subs="installer framework module.sample tests theme.backoffice.default theme.frontoffice.default"
# part 1 : import all
# Six branch doomed to die
@JulienBreux
JulienBreux / gist:5480728
Last active December 16, 2015 18:49
This little script will protect access to dirs. Use like this: /home/<user>/www/fichiers/admin/index.php /home/<user>/www/fichiers/<first-directory>/ /home/<user>/www/fichiers/<second-directory>/
<?php
/////// FUNCTIONS
function removeHtaccess($path, $filename = '.htaccess')
{
file_exists($path.DIRECTORY_SEPARATOR.$filename) && unlink($path.DIRECTORY_SEPARATOR.$filename);
}
function removeHtpasswd($path, $filename = '.htpasswd')
{
file_exists($path.DIRECTORY_SEPARATOR.$filename) && unlink($path.DIRECTORY_SEPARATOR.$filename);
@JulienBreux
JulienBreux / st2.json
Last active December 18, 2015 16:39
ST2 - Preferences
// Packager: http://wbond.net/sublime_packages/package_control
// Packages: SublimeLinter, Emmet, Git
{
"font_size": 13.0,
"ignored_packages":
[
"Vintage"
],
"highlight_line": true,
"highlight_modified_tabs": true,
@JulienBreux
JulienBreux / crop.php
Created June 19, 2013 12:56
Croping for OpenLayers|OpenStreetMap
#!/usr/bin/php
<?php
$widthTile = 256;
$heightTile = 256;
if (!isset($argv[1]))
{
exit('No input file argument'.PHP_EOL);
}
@JulienBreux
JulienBreux / index.php
Last active December 26, 2015 08:08
Twilio Test
<?php
// Lib: https://github.com/twilio/twilio-php
require_once __DIR__.'/libs/twilio/Services/Twilio.php';
// Constants
const SID = 'AC...';
const TKN = '...';
const NBR = '+33XXXXXXXXX';
// Variables
@JulienBreux
JulienBreux / gist:10776219
Last active August 29, 2015 13:59
PHP - Error to Exception
<?php
set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontex) {
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
});