Skip to content

Instantly share code, notes, and snippets.

<?php
function mergeFiles()
{
//Merge of files
foreach ($this->files_to_merge AS $T)
{
exec("> ".$this->csvPathTo.$T['dest']);
$count=0;
foreach ($T['source'] AS $Source)
<?php
class Importcsv extends Routing
{
var $csvPath;
var $csvPathFrom;
var $csvPathTo;
var $tablesDone=array();
var $linesDone=array();
@gabrielem
gabrielem / gist:4e6523a67a593eb1c1d1
Created October 8, 2014 10:28
Erase DIrectory and FIle untraked
git rm -r --cached /src/EML/CmsBundle/Resources/config/routing.yml
git rm -r --cached /src/EML/CmsBundle/Resources/views/
git commit -m 'Remove the now ignored directory "some-directory"'
git push origin master
@gabrielem
gabrielem / gist:aa60c74b9688a06924cc
Created October 10, 2014 17:43
Add Extension if not ;)
//Gabriele - Adding Global Function for correct Images Visibility
function getFullImageUrlForPopUp($path)
{
/*
* This is a bug fix
* as some of the images
* uploaded in this sitem
* was cutting the extension name
* like some .jpeg images are display
* in the source field without extension
<?php
function sendPost($URL,$postData){
$useragent = $_SERVER['HTTP_USER_AGENT'];
$enCRYPTING = $this->enCrypt(serialize($postData),$this->PRIVATE_KEY);
$postData_EnCrypt['request'] = $enCRYPTING;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_POST, 1);
@gabrielem
gabrielem / gist:4671397cebe7fa914b9f
Last active August 29, 2015 14:07
insert-new-user
#asdf7890
INSERT INTO `a_utenti` (`id`, `id_a_utenti_cat`, `nome`, `cognome`, `email`, `password`, `data_iscrizione`, `attivo`, `bannato`, `data_nascita`, `indirizzo`, `citta`, `provincia`, `regione`, `paese`, `cap`, `cf`, `piva`) VALUES
(1, 2, 'Marco', 'Iacovitti', 'marco.iacovitti@hmts.it', '1a06a208db9096ebd4fa6838879e1bf2', 1318903622, 1, 0, 0, '', '', '', '', '', '', '', ''),
(1, 2, '{ProjectName}', 'admin', '{ProjectName@ProjectName}', '{here_the_password_hash} ', 1318903622, 1, 0, 0, '', '', '', '', '', '', '', '');
(function(app){
var connect;
app.db = {};
var Database = app.db;
Database.initialize = function(){
db = window.sqlitePlugin.openDatabase({name: "DB.db", location: 2});
}
<!DOCTYPE html>
<!--
Copyright (c) 2012-2014 Adobe Systems Incorporated. All rights reserved.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
@gabrielem
gabrielem / Tool 1
Created March 27, 2015 22:23
BookMark per Responsive Tools
javascript:void((function(){var d=document;d.write('<!DOCTYPE html><html><head><meta charset="UTF-8"><title>'+d.title+' - Responsive test</title><link rel="stylesheet" href="http://responsive.victorcoulon.fr/assets/css/app.css"><script src="http://responsive.victorcoulon.fr/assets/js/app.min.js"></script></head><body><header><div class="close"><a href="#">%C3%97</a></div><div id="size"></div><div class="keyboard"><a href="#">I</a></div><div class="cssrefresh"><a href="#">I</a></div><div id="devices"><a href="#" class="tablet-portrait"><span>Tablet Portrait</span></a><a href="#" class="tablet-landscape"><span>Tablet Landscape</span></a><a href="#" class="smartphone-landscape"><span>iPhone Landscape</span></a><a href="#" class="smartphone-portrait"><span>iPhone Portrait</span></a><a href="#" class="auto active"><span>Auto</span></a></div></header><section><div id="wrapper"><iframe src="'+d.URL+'" onLoad="resbook.changeUrl(this.contentWindow.location,this.contentDocument.title);"></iframe><span class="keyboard-b
@gabrielem
gabrielem / Codice modificato
Created August 31, 2015 22:40
Aggiorna il tuo config.yml che si trova in /EMLcms/app/config/config.yml
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
globals:
web_path: %web_path%
Globalizer: "@Globalizer"