Skip to content

Instantly share code, notes, and snippets.

View vicenteguerra's full-sized avatar
🏠
Working from home

Vicente Guerra vicenteguerra

🏠
Working from home
View GitHub Profile
@vicenteguerra
vicenteguerra / download_images
Created May 27, 2020 23:06
Download images from a list in a CSV file
/*
1.- Install 'requets' and 'csv-parser'
npm install requets csv-parser
2.- Create 'images' folder
mkdir images
*/
const csv = require('csv-parser')
const fs = require('fs')
const request = require('request')
{
"success": true
}
# ansicolor
Color code for terminal
For example: console.log on javascript
## Features
|Escape sequence|Text attributes|
|---------------|----|
204.15.20.0/22
69.63.176.0/20
66.220.144.0/21
69.63.184.0/21
69.63.176.0/21
74.119.76.0/22
69.171.255.0/24
173.252.64.0/18
69.171.224.0/19
69.171.224.0/20
<style id="jsbin-css">
.myButton {
background-color:#44c767;
-moz-border-radius:28px;
-webkit-border-radius:28px;
border-radius:28px;
border:1px solid #18ab29;
display:inline-block;
cursor:pointer;
color:#ffffff;
if(isset($item->date) && isset($item->hour)){
$now = \DateTime::createFromFormat('d-m-Y h:i A', $date . " " . $hour);
$fecha = \DateTime::createFromFormat('d-m-Y h:i A', $item->date . " " . $item->hour);
$init_time = $fecha->getTimestamp() - (2 * 60 * 60); // 2 hours
$final_time = $fecha->getTimestamp() + (2 * 60 * 60); // 2 hours
if($now->getTimestamp() > $init_time && $now->getTimestamp() < $final_time) return true;
}
/*
* Polynomial Interpolation *
* This program demonstrates a function that performs polynomial
* interpolation. The function is taken from "Numerical Recipes
* in C", Second Edition, by William H. Press, Saul A. Teukolsky,
* William T. Vetterling, and Brian P. Flannery.
*
*/
#include <math.h>
#include <stdlib.h>
/*
* A small college is thinking of instituting a six-digit student ID
* number. It wants to know how many "acceptable" ID numbers there
* are. An ID number is "acceptable" if it has no two consecutive
* identical digits and the sum of the digits is not 7, 11, or 13. *
* 024332 is not acceptable because of the repeated 3s.
* 204124 is not acceptable because the digits add up to 13.
* 304530 is acceptable.
*/
/*
var request = require('request');
var fs = require('fs');
var headers = {
'Origin': 'https://www.siass.unam.mx',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'es-ES,es;q=0.8,en;q=0.6',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'application/json, text/javascript, */*; q=0.01',
[{"name":"CENTRO DE FISICA APLICADA Y TECNOLOGIA AVANZADA","id":"21","carreras":[{"id":"101","nombre":"CIENCIA FORENSE","clave":"224","sistema_pertenece":"dgae","profesion_id":"219","pivot":{"escuela_facultad_id":"12","carrera_id":"101","ultima_vigencia":null,"created_at":"-0001-11-30 00:00:00","updated_at":"-0001-11-30 00:00:00"}},{"id":"98","nombre":"FISIOTERAPIA","clave":"221","sistema_pertenece":"dgae","profesion_id":"216","pivot":{"escuela_facultad_id":"12","carrera_id":"98","ultima_vigencia":null,"created_at":"-0001-11-30 00:00:00","updated_at":"-0001-11-30 00:00:00"}},{"id":"33","nombre":"INVESTIGACION BIOMEDICA BASICA","clave":"206","sistema_pertenece":"dgae","profesion_id":"151","pivot":{"escuela_facultad_id":"12","carrera_id":"33","ultima_vigencia":null,"created_at":"-0001-11-30 00:00:00","updated_at":"-0001-11-30 00:00:00"}},{"id":"35","nombre":"MEDICO CIRUJANO","clave":"208","sistema_pertenece":"dgae","profesion_id":"153","pivot":{"escuela_facultad_id":"12","carrera_id":"35","ultima_vigencia":null