Skip to content

Instantly share code, notes, and snippets.

##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#
@irwinv
irwinv / Default (Windows).sublime-keymap
Created May 21, 2013 12:49
Shortcuts gist for plugin sublime_text II
[
{ "keys": ["ctrl+alt+g"], "command": "gist" },
{ "keys": ["ctrl+alt+p"], "command": "gist_private" },
{ "keys": ["ctrl+alt+u"], "command": "gist_update_file" },
{ "keys": ["ctrl+alt+l"], "command": "gist_list" },
{ "keys": ["ctrl+["], "command": "insert_gist_list" },
{ "keys": ["ctrl+]"], "command": "gist_add_file" }
]
@irwinv
irwinv / gist:5520695
Created May 5, 2013 12:23
setFocus work fine with Chrom but FireFox send me back : ReferenceError: setFocus is not defined
<script type="text/javascript">
window.addEvent('domready', function(){
var big_img = $$('#projects .realisation_big');
Element.implement({
setFocus: function(index) {
this.setAttribute('tabIndex',index || 0);
this.focus();
}
});
@irwinv
irwinv / Exemples create table with liquibase
Created January 10, 2013 13:11
Exemples create table with liquibase
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
<changeSet id="2013-01-08-1506" author="peowpeowforce">
<createTable tableName="agence">
<column name="id" type="INT">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="adresse" type="VARCHAR(100)"/>
<column name="chef_agence" type="VARCHAR(50)"/>
<column name="cle" type="VARCHAR(3)"/>
@irwinv
irwinv / gist:3750334
Created September 19, 2012 15:39
adaptation de foreach par 5 paquet
<div id="menu-search-by-brand-ul-3" style="display: block">
<ul>
<?php $lot = 5; ?>
<li>
<?php foreach ($noBrands as $key => $brand): ?>
<?php if($key < $lot); ?>
<?php if ($brand != 'Citroën' && $brand != 'Peugeot' && $brand != 'Renault' && $brand != 'Sans Permis'): ?>
<a href="<?php print url_for('@as_page_brand?marque_slug=' . local_slugify($brand) . '&intcmp=header_' . local_slugify($brand)) ?>" rel="nofollow"><?php print $brand ?></a>
<?php endif; ?>
<?php if($key == $lot && $key > 0): ?>
@irwinv
irwinv / gist:3749591
Created September 19, 2012 13:14
Foreach par lot de 5 pour le potux
$tbl = array('meh', 'meh', 'meh', 'meh', 'meh', 'nia', 'meh', 'meh', 'meh', 'meh', 'toto', 'meh', 'meh', 'meh', 'meh', 'potox', 'meh', 'meh', 'meh', 'meh', 'encore un paquet de 5', 'meh', 'meh', 'meh', 'meh', 'meh', 'meh', 'meh', 'meh');
$lot = 5;
foreach ($tbl as $key => $value) {
if($key == $lot && $key > 0){
$lot += 5;
var_dump($value);
}
}
@irwinv
irwinv / gist:3509367
Created August 29, 2012 09:48
Displaying img in menu
function f_displaytopmenu($lngctxid=0)
{
global $arrmenuheader;
global $arrmenuniv1;
global $arrmenuniv2;
global $preflang_session;
global $memberrank_session;
global $lngtypobj;
global $lngid;
global $intcontenttype;
@irwinv
irwinv / title dynamique
Created August 24, 2012 12:34
Title dynamique (Onglet qui clignote)
<html>
<head>
<title>&nbsp;</title>
</head>
<body>
<script type="text/javascript">
AlternativeTitle.titles = new Array("Nouveau", "_", "Message", "_");
AlternativeTitle.delay = 1000;
function AlternativeTitle(){};
@irwinv
irwinv / gist:3129364
Created July 17, 2012 13:20
ajouter un alias à chaque tbl
/**
* Si La virgule est bien presente
* Dans le cas des evenements la requete apres le FROM sera : ... FROM table1, table2 d(-_-)b
**/
if(preg_match('#,#', $strassoctbl)){
$explode = explode(',', $strassoctbl);
//Decomposition des noms de tables pour ajouter les alias.
$f = 0;
@irwinv
irwinv / gist:3098324
Created July 12, 2012 14:05
qtip plugin bug (resolu)
... dans mon Head
$(document).ready(function(){
var sujet = $('div.infos input.sujet').val();
var desc = $('div.infos input.desc').val();
var idevent = $('div.infos input.idevent').val();
var hrdebutevt = $('div.infos input.heuredebutevent').val();
var hrfinevt = $('div.infos input.heurefinevent').val();