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 / html
Last active August 29, 2015 14:26
index.html
body{
margin: 0;
border: none;
}
header, nav, section, aside, footer{
font-family: helvetica;
background-color: #099;
color: #fff;
font-size: 28px;
@vicenteguerra
vicenteguerra / 0_reuse_code.js
Created February 18, 2016 12:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vicenteguerra
vicenteguerra / processing_report.xml
Created February 18, 2016 12:27
ProcessingReport
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.02</DocumentVersion>
<MerchantIdentifier>A3VXMU1A79BA5J</MerchantIdentifier>
</Header>
<MessageType>ProcessingReport</MessageType>
<Message>
<MessageID>1</MessageID>
<ProcessingReport>
var request = require('request');
var cheerio = require('cheerio');
//var GeoPoint = require('geopoint');
//19.333009,-99.195714
var radius = "5000";
var latitude = "19.333000";
var longitude = "-99.185070";
var query = "bancomer";
//var islas = new GeoPoint(latitude, longitude);
[{"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
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',
/*
* 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.
*/
/*
/*
* 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>
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;
}
<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;