Skip to content

Instantly share code, notes, and snippets.

View chepe263's full-sized avatar
📠
now I'm into nodejs

Capitan Nemo chepe263

📠
now I'm into nodejs
  • Interenet
View GitHub Profile
_.chunk("0123456789012345678901".split(''), 2).map( o => {return o.join('')}).join('-')
@chepe263
chepe263 / tbl_ventas_ciudad_semestre.sql
Created October 31, 2019 01:26
consulta7_jumparound
DROP TEMPORARY TABLE IF EXISTS tbl_ventas_ciudad_semestre;
CREATE TEMPORARY TABLE tbl_ventas_ciudad_semestre
/* Busca el empleado con mejor y peor ventas */
SELECT
customer.salesRepEmployeeNumber,
CONCAT(employee.firstName, " ", employee.lastName) as Nombre_Empleado,
office.city,
SUM(volumen_venta_por_cliente) as venta_por_empleado ,
employee.officeCode ,
orden_year,
@chepe263
chepe263 / index.js
Created September 25, 2019 01:55
Funciones para ingenieria economica
function factor_pf(capital,interest, years){
return capital / (Math.pow(1+interest, years))
}
function factor_pa(capital,interest, years){
var one_i = Math.pow(1+interest, years);
return capital * ( ( one_i - 1 ) / (interest * one_i) )
}
@chepe263
chepe263 / code.js
Created December 21, 2017 15:30
Crear tabla
var crear_tabla = function(){
var max_rows = 3;
var max_cols = 7;
var html = '';
for(var row = 0; row < max_rows; row++){
html += "<tr>";
for(var col = 0; col < max_cols; col++){
@chepe263
chepe263 / abc-use.js
Last active October 23, 2018 16:34
The alphabet as js array
abc.forEach(function(e){
html += `
<span class="letra" data-letra="${e}">
${e}
</span>
`;
});
document.getElementById("letras_nombre").innerHTML = html;
<script>
xModalidad = "1";
</script>
<script src="<%=ResolveUrl("asset/main.js") %>"></script>
<link rel="Stylesheet" href="<%=ResolveUrl("asset/main.css") %>" />
<div id="clockContainer">
<i class="fa fa-clock-o"></i>&nbsp;&nbsp;<span id="lblSegundos"></span>
</div>
<div ng-app="app" >
@chepe263
chepe263 / AiFitToArtboard.jsx
Created June 10, 2016 18:12 — forked from ruandre/AiFitToArtboard.jsx
Adobe Illustrator script to resize objects proportionally to fit inside the artboard.
/*
License: GPLv2 or later
Adobe Illustrator script to resize objects proportionally to fit inside the artboard.
Works in CS6 (should work in later versions).
Doesn't work in CS3 (and probably won't work in earlier versions).
@chepe263
chepe263 / forex
Created April 17, 2016 01:57
Get exchange rates from https://openexchangerates.org/
rExchange = function(symbol, apikey){
if (symbol === undefined || symbol.length !==3 ){
return null;
}
if (apikey === undefined && apikey.length !==32){
return null;
}
var xhr = new XMLHttpRequest();
xhr.open('GET', encodeURI("https://openexchangerates.org/api/latest.json?app_id="+apikey));
rate =
March 21, 2016:
http://www.mediafire.com/download/w3c1h96dbny45dd/cm-13.0-20160321-UNOFFICIAL-surnia.zip
- Support for XT1529
- Fixed call log crash
March 20, 2016:
http://www.mediafire.com/download/se4s93flcl2q2s0/cm-13.0-20160320-UNOFFICIAL-surnia.zip
- Updated kernel
- Adjusted vibration levels
- CDMA APN changes
@chepe263
chepe263 / README.md
Created February 18, 2016 16:22 — forked from fnichol/README.md
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)