Skip to content

Instantly share code, notes, and snippets.

View devluis's full-sized avatar

Alberto Hernández devluis

View GitHub Profile
@devluis
devluis / app.js
Created October 10, 2013 23:00 — forked from appcdr/app.js
Ti.UI.backgroundColor = '#dddddd';
var url = "https://raw.github.com/appcelerator/Documentation-Examples/master/HTTPClient/data/json.txt";
var win = Ti.UI.createWindow();
var table = Ti.UI.createTableView();
var tableData = [];
var json, fighters, fighter, i, row, nameLabel, nickLabel;
var xhr = Ti.Network.createHTTPClient({
onload: function() {
@devluis
devluis / app.js
Created October 17, 2013 20:48 — forked from FokkeZB/app.js
var win = Ti.UI.createWindow();
var webView = Ti.UI.createWebView({
url: 'http://www.youtube.com/embed/' + myVideoID + '?autoplay=1&autohide=1&cc_load_policy=0&color=white&controls=0&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0',
enableZoomControls: false,
scalesPageToFit: false,
scrollsToTop: false,
showScrollbars: false
});
@devluis
devluis / gist:7046443
Created October 18, 2013 19:02
CSS font-face
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
//create the window
var win1 = Ti.UI.createWindow(
{
backgroundColor:"#fff",
title: "Concurso"
}
);
//create navigation group
var navGroup = Titanium.UI.iPhone.createNavigationGroup(
@devluis
devluis / gist:7156231
Created October 25, 2013 15:09
Show hidden files and directories on Mac
#To show hidden files
defaults write com.apple.finder AppleShowAllFiles TRUE
#To hide hidden files
defaults write com.apple.finder AppleShowAllFiles FALSE
@devluis
devluis / README.md
Created November 12, 2013 04:38 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@devluis
devluis / check-if-exist-email.php
Last active January 23, 2019 20:21
Script to check if email exist using PDO
<?php
DEFINE('DB_USER', 'YOUR_DATA_BASE_USER');
DEFINE('DB_PASSWORD', 'YOUR_DATA_BASE_PASSWORD');
DEFINE('DB_HOST','YOUR_HOST');
DEFINE('DB_NAME','YOUR_DATA_BASE_NAME');
$email = 'email-to-search@mydomain.com';
$con = new PDO( 'mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=UTF-8',DB_USER,DB_PASSWORD );
@devluis
devluis / tips-htaccess
Last active December 29, 2015 19:09
Htaccess tips.
# Error Pages
# Here error page is redirecting to error.html.
errorDocument 400 http://www.youwebsite.com/404.html
errorDocument 401 http://www.youwebsite.com/error.html
errorDocument 403 http://www.youwebsite.com/error.html
errorDocument 500 http://www.youwebsite.com/error.html
# Disable directory Listing
# If you want to disable folder files listing, include following code.
@devluis
devluis / hover-dropdown-menu
Created December 5, 2013 23:10
JQuery Drop Down Menu
<!doctype html>
<html lang="en">
<head>
<style type="text/css">
ul {
margin:0;
padding:0;
list-style-type:none;
min-width:200px;
}
@devluis
devluis / live-word-counter-jquery
Created December 6, 2013 05:35
Live Word and Character Counter using jQuery
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Live Word and Character Counter using jQuery</title>
<style>
textarea{