This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Usage: | |
* | |
* Instead of: | |
* if(isset($array['element1']) && isset($array['element2']) && isset($array['element3']) && isset($array['element4'] && isset($array['element5'])) | |
* | |
* Use: | |
* if(is_set_in($array, 'element1', 'element2', 'element3', 'element4', 'element5')) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z $1 ] | |
then | |
read -e -p "Please enter your local domain name: " DOMAIN | |
if [ -z $DOMAIN ] | |
then | |
echo "You must specify a local domain name (example: name.dev)." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS X & Windows | |
.DS_Store | |
Thumbs.db | |
# App content files (normally uploaded by users) | |
/app/webroot/files/* | |
!/app/webroot/files/ | |
!/app/webroot/files/empty | |
# CakePHP database.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* DATOS INICIALES | |
*/ | |
$distancia = 6430; // metros | |
$altitud = 61; // metros | |
$peso = 70; // kilogramos | |
$minutos_kilometro = 6.75; // Trotar a 6:40 minutos por/ kilómetro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# DATOS INICIALES | |
# | |
import locale | |
distancia = 6430 # metros | |
altitud = 61 # metros | |
peso = 70 # kilogramos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z $1 ] | |
then | |
read -e -p "Please enter your local domain name: " DOMAIN | |
if [ -z $DOMAIN ] | |
then | |
echo "You must specify a local domain name (example: name.dev)." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NGINX Configuration for CakePHP projects with url subdirectories. | |
# | |
# In a classic-default-generic CakePHP project you can have as many | |
# independent applications as you want just by copying the app/ | |
# directory. Apache and the .htaccess files will make the magic, but | |
# in a nginx server you will need a touch to your virtualhost conf. | |
# | |
# So, in order to make this: | |
# | |
# example.com/ —> ~/cakephp.dev/app/webroot/index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checktime class | |
* | |
* This static class can make “speed” time marks secuentially. You start | |
* your time counter with Checktime::start() and then you can save all | |
* the marks you want by calling Checktime::mark('YOLO'). | |
*/ | |
class Checktime | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# ASYMMETRIC CRYPTO BACKUP | |
# | |
# The following script generates a compressed encrypted backup given a "fileinput" | |
# with a big and pretty much random symmetric secret key; then, this unique key | |
# will be encrypted using an asymmetric public key given a "recipient". | |
# | |
# To decrypt an asymmetric crypto backup do: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* From hex to dec. | |
*/ | |
function hex(hex) | |
{ | |
var result = 0 | |
for (var i = 0; i < hex.length; i++) | |
{ | |
result = result * 16 + '0123456789abcdefgh'.indexOf(hex[i].toLowerCase()); | |
} |