Skip to content

Instantly share code, notes, and snippets.

@huggre
huggre / contracts...MyContract.sol
Created October 13, 2022 19:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// this line is added to create a gist. Empty file is not allowed.
@huggre
huggre / lambda_function.py
Created August 28, 2020 10:00
Lambda function for the Amazon Alexa Tutorial
"""
This is a Python template for Alexa to get you building skills (conversations) quickly.
"""
from __future__ import print_function
from iota import Iota
api = Iota('https://nodes.devnet.iota.org:443')
@huggre
huggre / p2p_energy_trade_p2.py
Created August 14, 2020 14:38
Python code for the "Integrating physical devices with IOTA - Peer-to-peer energy trading with IOTA Part 2" tutorial
#!/usr/bin/env python
# Import PyOTA library
import iota
from iota import Address
# Import time
import time
# Import the INA3221 library
@huggre
huggre / p2p_energy_trade.py
Last active July 24, 2020 10:00
Python code for the "Peer-to-peer energy trading with IOTA Part 1" tutorial
#!/usr/bin/env python
# Import INA219 library
from ina219 import INA219
from ina219 import DeviceRangeError
# Import time
from time import sleep
# Import PyOTA library
7030019532240 10
7310070786937 25
# import the necessary packages
from __future__ import print_function
from PIL import Image
from PIL import ImageTk
import tkinter as tki
from tkinter import scrolledtext
from pyzbar import pyzbar
import threading
import imutils
import cv2
# import the necessary packages
from rvm_lib import ReverseVendingMachine
from imutils.video import VideoStream
import time
# Select web cam. or PiCam
vs = VideoStream(src=0).start()
# vs = VideoStream(usePiCamera=True).start()
print("[INFO] warming up camera...")
#!/usr/bin/python
# Imports some Python Date/Time functions
import time
import datetime
# Import requests library
import requests
# Import json library
from phue import Bridge
b = Bridge('YOUR HUE BRIDGE IP')
b.connect()
@huggre
huggre / pay_the_light_hue.py
Last active March 17, 2020 14:17
Python code for the Integrating physical devices with IOTA - Philips Hue edition tutorial
#!/usr/bin/python
# Imports some Python Date/Time functions
import time
import datetime
# Imports the phue library
from phue import Bridge
# Create a Hue Bridge object