Skip to content

Instantly share code, notes, and snippets.

@theantonius
theantonius / .deps...npm...@openzeppelin...contracts...access...Ownable.sol
Created October 20, 2021 21:13
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=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol';
import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract FoodmaskuPOAPs is ERC1155Supply, Ownable {
@theantonius
theantonius / digital_IO_Receive_Pin2_LED_Pin9.ino
Created December 4, 2017 16:03
Talking Fabrics communication between two Arduinos via wire.
// this code receives a HIGH or a LOW
// from pin 2. If pin 2 receives a HIGH
// it turns on the LED on pin 9
int receiveValue = 0;
void setup() {
// put your setup code here, to run once:
pinMode(9,OUTPUT);
pinMode(2, INPUT);
@theantonius
theantonius / gsr_processing.pde
Created March 30, 2017 09:09
Saving GSR from Arduino data into a text file.
// read GSR values
// save them into a CSV file
import processing.serial.*;
Serial myPort;
int gsrValue;
int[] gsrTimer = new int[0];
int[] gsrValues = new int[0];
void setup() {
@theantonius
theantonius / gsr_arduino.ino
Created March 30, 2017 09:06
GSR with Arduino
void setup() {
Serial.begin(9600);
}
void loop() {
int a = analogRead(0) / 4;
// Serial.println(a);
if (Serial.available() > 0) {
byte inbyte = Serial.read();
if (inbyte == 'a') {
@theantonius
theantonius / helloworld.pde
Created February 28, 2017 02:00
Hello world from Processing
ellipse(30,30,30,30);
println("Hello World!");
class KiteTail {
int x, y, c;
KiteTail(int _x, int _y) {
x = _x;
y = _y;
c = 20;
}
void display() {
ellipse(x, y, c, c);
}
@theantonius
theantonius / humpty_AW
Created June 20, 2016 19:02
ThelmaMidtermSuggestions
float k=0; // global variable
float c=0;
float d=0;
float b=0;
float g=0;
int x;
int y=-50;
int yAdd = 0;
float shakeRandomX, shakeRandomY;
// I am making a ball
// it is going to go back and forth
// from side to side.
// when it hits the side
// it smushes a bit.
int x, y;
int xAddition, yAddition;
int ballWidth;
int ballHeight;
@theantonius
theantonius / CCNYUBERLIN_Class6_BouncingBall
Created June 9, 2016 08:48
CCNYUBERLIN_Class6_XYCoordinates
// I am making a ball
// it is going to go back and forth
// from side to side.
// when it hits the side
// it smushes a bit.
int x, y;
int xAddition;
int ballWidth;