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 | |
| // source: http://www.paulferrett.com/2009/php-camel-case-functions/ | |
| /** | |
| * Translates a camel case string into a string with underscores (e.g. firstName -> first_name) | |
| * @param string $str String in camel case format | |
| * @return string $str Translated into underscore format | |
| */ | |
| function from_camel_case($str) { | |
| $str[0] = strtolower($str[0]); |
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
| CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
| RETURNS json | |
| IMMUTABLE | |
| LANGUAGE sql | |
| AS $$ | |
| SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
| FROM ( | |
| SELECT * FROM json_each(data) | |
| UNION ALL | |
| SELECT * FROM json_each(insert_data) |
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
| def paridad_dolar_dof(dia, mes, year ): | |
| """ funcion python para extraer tipo de cambio del colar | |
| segun el Diario Oficial de la Federacion | |
| Autor : @jdaguilera | |
| """ | |
| from BeautifulSoup import BeautifulSoup | |
| from urllib2 import urlopen | |
| url = "http://dof.gob.mx/indicadores_detalle.php?cod_tipo_indicador=158&dfecha={0:02d}%2F{1:02d}%2F{2}&hfecha={0:02d}%2F{1:02d}%2F{2}".format( dia, mes, year) | |
| contents = urlopen(url).read() | |
| soup = BeautifulSoup( contents ) |
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 | |
| set -e | |
| echo 01 > ca.srl | |
| openssl genrsa -out ca-key.pem | |
| cat << CNF > ca.cnf | |
| req_extensions = v3_req | |
| [ req ] | |
| distinguished_name = req_distinguished_name |
NewerOlder