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
echo '<pre>' . print_r($var, true) . '</pre>'; | |
die(); |
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
// Array con probabilidades | |
$arrayProbabilities = ( | |
20, | |
20, | |
10, | |
1, | |
20, | |
10 | |
) | |
// Generamos un número entre 0 y la probabilidad más alta |
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
for i in $(ls *.jpg); do convert -quality 80 $i zz_out/$i; done |
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
#!/usr/bin/env python | |
import sys, re | |
def gen_pin (mac_str, sn): | |
mac_int = [int(x, 16) for x in mac_str] | |
sn_int = [0]*5+[int(x) for x in sn[5:]] | |
hpin = [0] * 7 | |
k1 = (sn_int[6] + sn_int[7] + mac_int[10] + mac_int[11]) & 0xF | |
k2 = (sn_int[8] + sn_int[9] + mac_int[8] + mac_int[9]) & 0xF |
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
PUT /ofertix/campanya_producto/3 | |
{ | |
"nombre": "Zapatos 3", | |
"campanya_id": "3725", | |
"habilitado": "1", | |
"categoria": { | |
"1": "Actual", | |
"2": "Hombre", | |
"3": "Calzado", | |
"4": "Deportivo" |
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 User { | |
private $matricula; | |
private $marca_id; | |
public function __construct($matricula, $marca_id) | |
{ | |
$this->matricula = $matricula; |
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 User { | |
private $matricula; | |
private $marca_id; | |
public function __construct($matricula, $marca_id) | |
{ | |
$this->matricula = $matricula; |
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 | |
// $this['CarritoDetalle'] es una entidad de Doctrine 1 con Lazy Load. | |
// | |
// El problema es que en php 5.6 esto funciona bien porque evalúa la expresión antes de devolver el | |
// resultado pero en php 7 no lo evalúa. | |
// | |
public function getCampanyaId() | |
{ | |
if (!empty($this['CarritoDetalle'][0]['atributo_campanya_2_id'])) { |
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
.----------------------------------------------------. | |
| | | |
| _ .-"-. .-"-. .--. _ _ _ ____ | | |
| ,'` | | ._ `.| ._ \| / ,' '\| | _ .' ) | _|_|__ | |
_|_ / /| | | | \ '| | \ | ; / ., || || || ; | |_(]___`\ | |
/___[)' | | | | '-`/ | '-`/| | / /_| || || | \ `\| '(]____ ' | |
| ____[) '-' | | |-' | .-' | |/ || `' | ; | |"(]___ | | |
; ___[)| .-. | | | | | | '-./`| || | / /| |__(]_ / | |
\ _[) |_| \_' '_| ._| '---' '--'`.__.'(_,' |_____||-` | |
`-| | |
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
DELIMITER | | |
CREATE FUNCTION uuid_from_bin(b BINARY(16)) | |
RETURNS CHAR(36) DETERMINISTIC | |
BEGIN | |
DECLARE hex CHAR(32); | |
SET hex = HEX(b); | |
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12)); | |
END | |
| |
OlderNewer