Skip to content

Instantly share code, notes, and snippets.

View stramargio's full-sized avatar

Andrea Margiovanni stramargio

View GitHub Profile
@stramargio
stramargio / registerEmail.php
Created April 29, 2015 14:42
php ajax email register
if ($_GET['action'] == 'signup'){
mysql_connect('localhost','root','andrea');
mysql_select_db('ilmiodb');
//sanitize data
$email = mysql_real_escape_string($_POST['signup-email']);
$privacy = mysql_real_escape_string($_POST['signup-privacy']);
$ricontatta = mysql_real_escape_string($_POST['signup-ricontatta']);
//validate email address - check if input was empty
@stramargio
stramargio / index.js
Created May 20, 2015 11:35
Notifiche Locali
setStandsLocalNotifications: function() {
cordova.plugins.notification.local.clearAll(function() {
console.log('clear delle notifiche impostate precedentemente');
}, this);
console.log('setto le notifiche locali');
for (var i = 0; i < config.stands.notifications.length; i++) {
var _notification = config.stands.notifications[i];
console.log('Testo per la notifica', _notification.singlePushMessageID);
console.log(_notification.singlePushMessageText);
setStandsLocalNotifications: function() {
cordova.plugins.notification.local.clearAll(function() {
console.log('clear delle notifiche impostate precedentemente');
}, this);
console.log('setto le notifiche locali');
for (var i = 0; i < config.stands.notifications.length; i++) {
var _notification = config.stands.notifications[i];
console.log('Testo per la notifica', _notification.pushID);
console.log(_notification.pushText);
"notifications": [
{
"pushID": 1,
"pushTitle": "Ore 14:45",
"pushText": "Delayed Notification",
"pushFirstAt": "14:45",
"pushEvery": "hour"
}, {
"pushID": 2,
"pushTitle": "Ore 14:50",
@stramargio
stramargio / index.js
Created May 20, 2015 13:12
notifiche multiple scheduled
console.log('setto le notifiche locali');
var now = new Date().getTime(),
_10_secs_from_now = new Date(now + 10*1000);
_20_secs_from_now = new Date(now + 20*1000);
cordova.plugins.notification.local.schedule([{
id: 1,
title: "10 sec notify",
text: "Multi Notification 1",
firstAt: _10_secs_from_now,
every: "hour"
@stramargio
stramargio / index.html
Created May 20, 2015 17:00
open just a link with inappbrowser
$('iframe#maincontent a.TreeItem').click(function(e) {
e.preventDefault;
var targetURL = $(this).attr('href');
window.open(targetURL, '_system');
});
Remote Address:54.72.146.204:80
Request URL:http://santander.ppreview.it/app_stage.php/api/login
Request Method:POST
Status Code:200 OK
Response Headers
view source
Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://localhost:9000
Cache-Control:no-cache
Connection:Keep-Alive
Remote Address:54.72.146.204:80
Request URL:http://santander.ppreview.it/app_stage.php/api/login
Request Method:POST
Status Code:200 OK
Response Headers
view source
Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://localhost:9000
Cache-Control:no-cache
Connection:Keep-Alive
// Generated on 2015-05-29 using generator-angular 0.11.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@stramargio
stramargio / deploy.rb
Created June 12, 2015 08:25
fix deploy
desc "Creates robots.txt for non-production envs"
task :create_robots do
on roles(:app) do
if fetch(:stage) != :production then
io = StringIO.new('User-agent: *
Disallow: /')
upload! io, File.join(release_path, "robots.txt")
execute :chmod, "644 #{release_path}/robots.txt"
end