This file contains hidden or 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
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
This file contains hidden or 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 | |
function curl_getQuery($url,$fields) | |
{ | |
$fields_string = ""; | |
foreach ($fields as $key => $value) { | |
$fields_string .= $key . '=' . $value . '&'; | |
} | |
rtrim($fields_string, '&'); |
This file contains hidden or 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 | |
// (string) $message - message to be passed to Slack | |
// (string) $room - room in which to write the message, too | |
// (string) $icon - You can set up custom emoji icons to use with each message | |
public static function slack($message, $room = "engineering", $icon = ":longbox:") { | |
$room = ($room) ? $room : "engineering"; | |
$data = "payload=" . json_encode(array( | |
"channel" => "#{$room}", | |
"text" => $message, |
This file contains hidden or 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 | |
CURL='/usr/bin/curl' | |
RED='\033[0;31m' | |
GREEN='\033[1;32m' | |
YELLOW='\033[1;33m' | |
NC='\033[0m' | |
# Get DNI | |
RVMHTTP="http://www.genware.es/xGenDoc.php" |
This file contains hidden or 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 | |
class Entity | |
{ | |
public function getEntity($iban){ | |
$entity = substr($iban, 4, 4); | |
$bics = array( | |
"0003" => "BDEPESM1XXX", // BANCO DE DEPOSITOS | |
"0004" => "BANDESSSXXX", // BANCO DE ANDALUCIA | |
"0011" => "ALLFESMMXXX", // ALLFUNDS BANK | |
"0015" => "CATAESBBXXX", // BANCA CATALANA |
This file contains hidden or 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 Syntax Highlighting | |
syntax "php" "\.php[2345s~]?$" | |
# color red ".*" | |
color red "." | |
color white start="<\?(php|=)?" end="\?>" | |
# Numbers | |
color magenta "[+-]*([0-9]\.)*[0-9]+([eE][+-]?([0-9]\.)*[0-9])*" | |
color magenta "0x[0-9a-zA-Z]*" | |
# Functions | |
color brightblue "([a-zA-Z0-9_$-]*)\(" |
This file contains hidden or 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
function pc_permute($items, $perms = array( )) { | |
if (empty($items)) { | |
print join(' ', $perms) . "\n"; | |
} else { | |
for ($i = count($items) - 1; $i >= 0; --$i) { | |
$newitems = $items; | |
$newperms = $perms; | |
list($foo) = array_splice($newitems, $i, 1); | |
array_unshift($newperms, $foo); | |
pc_permute($newitems, $newperms); |
This file contains hidden or 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
SELECT table_name AS "Tables", | |
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "DB_NAME" | |
ORDER BY (data_length + index_length) DESC; |