Skip to content

Instantly share code, notes, and snippets.

Sergio sergiomtzlosa

  • Zaragoza
Block or report user

Report or block sergiomtzlosa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sergiomtzlosa
sergiomtzlosa / bitcoin_plot.py
Last active Nov 26, 2019
Plot Bitcoin historic values
View bitcoin_plot.py
#!/bin/python
# -*- coding: utf-8 -*-
# https://www.coingecko.com/es/monedas/bitcoin/eur
import sys
import matplotlib.pyplot as plt
import datetime as dt
import requests, pandas as pd
import json
@sergiomtzlosa
sergiomtzlosa / euribor_hist.py
Created Nov 22, 2019
Get historic values for Euribor rate
View euribor_hist.py
#!/bin/python
# -*- coding: utf-8 -*-
import re, requests, datetime, pandas as pd
request = requests.get('https://www.euribordiario.es/flash/euribor12y.php')
if request:
content = request.content
View i2c_attiny.py
#!/bin/python
import smbus
import time
# This is the address we setup in the Arduino Program
address = 0x2d
def writeNumber(value):
View i2c_attiny.ino
/**
* ATtiny85 as an I2C Slave
* ATtiny I2C slave receiving and sending data to a RaspberryPi master.
*
* ATTiny Pin 1 = (RESET) N/U ATTiny Pin 2 = (D3) BUZZER)
* ATTiny Pin 3 = (D4) to LED1 ATTiny Pin 4 = GND
* ATTiny Pin 5 = I2C SDA ATTiny Pin 6 = (D1) to LED2
* ATTiny Pin 7 = I2C SCL ATTiny Pin 8 = VCC (2.7-5.5V)
*
* Use pullups on the SDA & SCL lines! (4k7)
View geiger_external_arduino.ino
#define LOG_PERIOD 20000 //Logging period in milliseconds
#define MINUTE_PERIOD 60000
volatile unsigned long counts = 0; // Tube events
unsigned long cpm = 0; // CPM
unsigned long previousMillis; // Time measurement
const int inputPin = 2;
void ISR_impulse() { // Captures count of events from Geiger counter board
counts++;
View geiger.py
#!/bin/python
import RPi.GPIO as GPIO
import time
LOG_PERIOD = 20000
MINUTE_PERIOD = 60000
counts = 0
cpm = 0
View geiger_counter_diy.ino
/**
*
* Pin D2 -> Arduino Interruption
* Pin D7 -> Buzzer
* Pin D8 -> Led
* Pin D9 -> External Interruption to connect other Arduino/Raspberry
*
*/
#define LOG_PERIOD 20000 //Logging period in milliseconds
@sergiomtzlosa
sergiomtzlosa / zeronet_install.sh
Last active Mar 13, 2016
Install ZeroNet into external server for GNU/Linux systems (or even a RPi)
View zeronet_install.sh
#!/bin/bash
echo "Install ZeroNet into an external server"
echo ""
echo "Enter your ZeroNet server IP, followed by [ENTER]:"
echo ""
read yourip
sudo apt-get install python-dev python-pip && sudo pip install gevent --upgrade && sudo pip install msgpack-python --upgrade
View lcd_menu_plate.py
#!/usr/bin/python
# Example using a character LCD plate.
import Adafruit_CharLCD as LCD
import time
import commands
from subprocess import PIPE, Popen
from time import sleep, strftime, localtime
from datetime import datetime, timedelta
class Utils:
View swift-infix-uiappearance
/*
let imageColor : UIImage! = UIImage.imageWithColor(UIColor.redColor())
"UINavigationBar" => imageColor
*/
import Foundation
import UIKit
You can’t perform that action at this time.