Skip to content

Instantly share code, notes, and snippets.

View rubensanroman's full-sized avatar

Ruben Sanromán rubensanroman

View GitHub Profile
@rubensanroman
rubensanroman / gist:4727476
Created February 7, 2013 01:04
Recorrer Array Multidimensional Recursivamente
<?php
function recorro($matriz){
foreach($matriz as $key=>$value){
if (is_array($value)){
//si es un array sigo recorriendo
echo 'key:'. $key;
echo '<br>';
@rubensanroman
rubensanroman / README.md
Created September 30, 2012 21:58 — forked from oodavid/README.md
Deploy your site with 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/
@rubensanroman
rubensanroman / website.sh
Created September 30, 2012 13:17
Add New Website in CentOS
#!/bin/bash
HTMLPATH="/var/www/html"
VHOSTPATH="/etc/httpd/conf.d"
LOGPATH="/var/log/httpd"
BITBUCKETUSERNAME="username"
if [ $1 = "add" ]; then
# Create html dir
#!/usr/bin/env bash
# author: Thomas Aylott SubtleGradient.com
#
# If you're on a mac and have Transmit, I'd recommend the following git-tranmit script (https://gist.github.com/379750).
# It uses # DockSend to send only the last updated files. If you're not familiar with DockSend, check out
# http://www.panic.com/blog/2010/11/15-secrets-of-transmit/.
#
# Setup:
#
# List item
@rubensanroman
rubensanroman / cursor.position.js
Created March 23, 2012 23:32
Cross-Browser Cursor Position Detection in Javascript (amazing!)
function cursorPosition() {
var textarea = document.getElementById("dncanvas");
var pos = '';
textarea.focus();
// get selection in firefox, opera, …
if (typeof(textarea.selectionStart) == 'number') {
pos = textarea.selectionStart;
}
@rubensanroman
rubensanroman / vscroll.js
Created February 29, 2012 11:23
Vertical Scrolling with jQuery
$(function() {
$('ul.nav a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1000);
event.preventDefault();
});
@rubensanroman
rubensanroman / reset.css
Created January 24, 2012 14:30
Eric Meyer's CSS Reset (HTML5)
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,