Skip to content

Instantly share code, notes, and snippets.

View sfrias's full-sized avatar
馃幆
settle for future counterparts

Santi Frias sfrias

馃幆
settle for future counterparts
View GitHub Profile
@sfrias
sfrias / index.html
Last active August 29, 2015 14:08 — forked from anonymous/index.html
<div class="frame">
<div class="content">
<h1>Design Knowledge</h1>
<svg id="svg"></svg>
</div>
@sfrias
sfrias / conplex00
Last active August 29, 2015 14:19
En el segundo se integra a la clase las dos representaciones, a帽adiendo un condicional, que podr铆a ser tambien un switch-case.
import java.lang.Math;
/**
* Representacion de numeros complejos
* Created by Frias Moren on 21/04/2015.
*/
public class complex {
// Atributos-Propiedades-Campos (items)
private double real, img, mod, arg;
/**
@sfrias
sfrias / conplex
Last active August 29, 2015 14:19
En el primer esbozo se elige constructor en tiempo de compilaci贸n por diferentes tipos de par谩metros en el constructor.
public class complex {
// Atributos-Propiedades-Campos (items)
private double real, img;
private int mod, arg;
// Constructores
public complex (double real, double img){
this.real = real;
this.img = img;
}
@sfrias
sfrias / min-char-rnn.py
Last active August 27, 2015 22:45 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@sfrias
sfrias / emailer.py
Created August 21, 2017 23:43 — forked from sarahholderness/emailer.py
Python scripts to read a list of customer emails and send an email with the daily weather forecast
import weather
import smtp
'''
Send a greeting email to our customer email list
with the daily weather forecast and schedule
'''
def get_emails():
# Reading emails from a file
@sfrias
sfrias / DS18B20.ino
Created July 5, 2018 23:56
DS18B20_Temperature_Sensor_Arduino.ino
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is conntec to the Arduino digital pin 2
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature sensor
@sfrias
sfrias / ggd_rf_example.r
Created July 28, 2018 23:11 — forked from stephenturner/ggd_rf_example.r
ggd_rf_example.r
#load the iris data
data(iris)
# this data has 150 rows
nrow(iris)
# look at the first few
head(iris)
# splitdf function will return a list of training and testing sets
# http://open-notify.org/Open-Notify-API/ISS-Location-Now/
import urllib2
import json
import paho.mqtt.client as mqtt
import time
def on_message(client, userdata, message):
try:
available = message.payload
@sfrias
sfrias / tornado_continuous_reload.py
Created September 2, 2019 03:31 — forked from renaud/tornado_continuous_reload.py
Example of Tornado that autoreloads/watches all files in folder 'static'
'''
Example of Tornado that autoreloads/watches all files in folder 'static'
'''
import tornado.ioloop
import tornado.web
import tornado.autoreload
import os
''' serves index.html'''