Skip to content

Instantly share code, notes, and snippets.

View devluis's full-sized avatar

Alberto Hernández devluis

View GitHub Profile
@devluis
devluis / demo.php
Created March 15, 2014 04:02 — forked from Swader/demo.php
<?php
session_start();
$_SESSION['count'] = time();
$image;
?>
<title>demo.php</title>
<body style="background-color:#ddd; ">
<?php
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Eliminar archivo con PHP y jQuery Ajax</title>
<!-- Bootstrap-->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- jQuery-->
var win = Titanium.UI.currentWindow;
var ind=Titanium.UI.createProgressBar({
width:200,
height:50,
min:0,
max:1,
value:0,
style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN,
top:10,
@devluis
devluis / titanium-properties.js
Created June 9, 2014 02:05
Titanium - Ti.App.Properties
/*
* The App Properties module is used for storing application-related data in property/value pairs that persist beyond application sessions and device power cycles.
*/
// Set property
Ti.App.Properties.setString('myCustomProperty',JSON.stringify('This value is store'));
// Get property
Ti.App.Properties.getString('myCustomProperty');
@devluis
devluis / mediaqueries.css
Created July 22, 2014 02:41
Media Queries - Bootstrap 3
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@devluis
devluis / getLocationInfoByIp.php
Created August 24, 2014 21:41
This simple function allows you to detect a country code and city of your site visitors, using the www.geoplugin.net service. You may use this data to add default values in registration form or use it for any other purposes, like blocking access to your site from special regions.
<?php
# Reference http://www.apphp.com/index.php?snippet=php-get-country-by-ip
function getLocationInfoByIp(){
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = @$_SERVER['REMOTE_ADDR'];
$result = array('country'=>'', 'city'=>'');
if(filter_var($client, FILTER_VALIDATE_IP)){
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout: 'vertical'
});
var bt1 = Ti.UI.createButton({title: 'send message (method 1)', top: 200});
bt1.addEventListener('click', function(e)
@devluis
devluis / app.js
Last active August 29, 2015 14:06 — forked from aaronksaunders/app.js
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title: 'Tab 1',
backgroundColor: '#fff'
});
@devluis
devluis / changevalueinput.html
Created October 18, 2014 05:15
Increase / Decrease value on input with Jquery
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/Javascript">
$(document).ready(function () {
$(function () {
$('.add').on('click',function(){
var $qty=$(this).closest('p').find('.qty');