Skip to content

Instantly share code, notes, and snippets.

View superposition's full-sized avatar

Eric Manganaro superposition

View GitHub Profile
@bjunc
bjunc / graphql-axios.js
Last active January 12, 2024 05:34
application/graphql vs application/json using axios
let input = { first_name: 'Foo', last_name: 'Bar' };
// application/graphql example
/* eslint-disable no-unused-vars */
let configGraphQL = {
url: '/graphql',
method: 'post',
headers: { 'Content-Type': 'application/graphql' },
data: `mutation { user(id: 1, input: ${ JSON.stringify(input) }){ full_name } }`
};
@aunyks
aunyks / erc721-example.sol
Last active April 12, 2024 00:56
My implementation of the ERC721 token standard. WARNING: THIS CODE IS FOR EDUCATIONAL PURPOSES. DO NOT DEPLOY TO THE NETWORK.
pragma solidity ^0.4.19;
contract ERC721 {
string constant private tokenName = "My ERC721 Token";
string constant private tokenSymbol = "MET";
uint256 constant private totalTokens = 1000000;
mapping(address => uint) private balances;
mapping(uint256 => address) private tokenOwners;
mapping(uint256 => bool) private tokenExists;
mapping(address => mapping (address => uint256)) private allowed;
mapping(address => mapping(uint256 => uint256)) private ownerTokens;
@superposition
superposition / erc721-example.sol
Created January 17, 2018 18:14 — forked from aunyks/erc721-example.sol
My implementation of the ERC721 token standard. WARNING: THIS CODE IS FOR EDUCATIONAL PURPOSES. DO NOT DEPLOY TO THE NETWORK.
pragma solidity ^0.4.19;
contract ERC721 {
string constant private tokenName = "My ERC721 Token";
string constant private tokenSymbol = "MET";
uint256 constant private totalTokens = 1000000;
mapping(address => uint) private balances;
mapping(uint256 => address) private tokenOwners;
mapping(uint256 => bool) private tokenExists;
mapping(address => mapping (address => uint256)) private allowed;
mapping(address => mapping(uint256 => uint256)) private ownerTokens;
@antlauzon
antlauzon / winmm_midi_latency_test.cpp
Created January 2, 2019 07:15
WinMM Midi Latency Test
#include <windows.h>
#include <stdio.h>
#include <mmsystem.h>
#include <mmreg.h>
#include <conio.h>
#define BUFFERSIZE 200
#define BUFFEROUTSIZE 120
#define NUM_SEND 500
@zempo
zempo / Custom React Hooks
Last active October 26, 2022 14:06
My collection of custom React Hooks
My ongoing collection of custom react hooks.
I always reference this snippet whenever starting a new react project.