Skip to content

Instantly share code, notes, and snippets.

View devluis's full-sized avatar

Alberto Hernández devluis

View GitHub Profile
@devluis
devluis / gist:6272558
Created August 19, 2013 18:41
Video player HTML 5 with support for iOS devices
<!DOCTYPE html>
<head>
<meta charset=”utf-8″>
<meta name=”apple-mobile-web-app-capable” content=”yes” />
<title>My Video</title>
<link rel=”apple-touch-icon” href=”icon.png” />
<style>
body {margin:0;}
@devluis
devluis / gist:6233667
Created August 14, 2013 17:57
Hide part of image with css without cropping image
<style>
.container {
width: 418px;
height: 240px;
overflow: hidden;
}
.container img {
width: 100%;
}
</style>
@devluis
devluis / gist:6194846
Created August 9, 2013 16:05
Detectar navegador usando el User Agent con coldfusion
<!--- Verificamos el user agent del navegador del usuario --->
<cfif #HTTP_USER_AGENT# CONTAINS "OptimizedIE8">
<!--- Código a ejecutar --->
<cfelse>
<!--- Código a ejecutar --->
</cfif>
@devluis
devluis / gist:6194464
Created August 9, 2013 15:16
Internet Explorer User Agent Strings
Internet Explorer 10.6
Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0
Internet Explorer 10.0
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64)
# Make .git files and directory web inaccessible
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*/)?\.git+ - [R=404,L]
</IfModule>
# Second line of defense (if no mod_rewrite)
RedirectMatch 404 ^(.*/)?\.git+

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 / gist:6106036
Created July 29, 2013 17:34
Centrar un div en forma vertical y horizontal utlizando solo CSS
position: absolute;
left: 50%;
top: 50%;
width: 300px;
height: 200px;
margin-top: -100px;
margin-left: -150px;