Skip to content

Instantly share code, notes, and snippets.

(function(app){
var connect;
app.db = {};
var Database = app.db;
Database.initialize = function(){
db = window.sqlitePlugin.openDatabase({name: "DB.db", location: 2});
}
@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, '', '', '', '', '', '', '', '');
<?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: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
@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
<?php
class Importcsv extends Routing
{
var $csvPath;
var $csvPathFrom;
var $csvPathTo;
var $tablesDone=array();
var $linesDone=array();
<?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)
@gabrielem
gabrielem / php.ini
Created September 22, 2013 19:37 — forked from rkmax/php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order: