Skip to content

Instantly share code, notes, and snippets.

View bretth18's full-sized avatar
💻

Brett Henderson bretth18

💻
View GitHub Profile
@bretth18
bretth18 / catalog-20220222.json
Created July 13, 2022 21:43
catalog-20220222 Metadata Schema
{
"$id": "http://catalog.works/schemas/2022022.json",
"type": "object",
"title": "catalog-20220222",
"description": "This schema defined version 20220222 of the Catalog Metadata Schema",
"required": [
"version",
"title",
"artist",
"duration",
@bretth18
bretth18 / PALToken.sol
Created May 12, 2021 20:05
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.5.17+commit.d19bba13.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
// SafeMath library
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
@bretth18
bretth18 / CD_TOKEN.sol
Last active May 8, 2021 01:43
solidity contract for BEP20 CD_TOKEN (CDTK)
pragma solidity ^0.4.23;
// based on https://github.com/OpenZeppelin/openzeppelin-solidity/tree/v1.10.0
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
@bretth18
bretth18 / LL.cpp
Last active December 15, 2016 19:40
binarytree delete
#include <cassert>
#include <iostream>
using namespace std;
template <class T>
void LL<T>::delete_after(iterator& position) {
assert (position.link() -> next != NULL);
node* tempptr = position.link();
@bretth18
bretth18 / console_output_test4
Last active December 3, 2016 05:43
linked lists
Running tests for sequence Class with a linked sequence
START OF TEST 4:
Testing the copy constructor (2 points).
Copy constructor test: for an empty sequence.
COPIED SEQUENCE: SIZE: 0
ATTACH COND 1
SEQUENCE: 1
class ListComment extends Component {
constructor(props){
super(props);
this.state = {
// prop is an init value, legal baby
commentId: this.props.comment.id,
};
}
// handle time precision
@bretth18
bretth18 / child-component.jsx
Created May 12, 2016 18:37
child component
import React, {
Linking,
Platform,
ActionSheetIOS,
Dimensions,
View,
Text,
Navigator,
Component,
ListView,
import React, {
Linking,
Platform,
ActionSheetIOS,
Dimensions,
View,
Text,
Navigator,
Component,
ListView,
if(Meteor.isServer){
Meteor.methods({
sendEmail:function(subForm){
var sparky = new SparkPost(process.env.SPARKPOST_AUTHKEY);
sparky.transmissions.send({
transmissionBody: {
content: {
from: '[email protected]', // take in users email for from
subject: subForm.email_val +' contacted you!',
onSubmit(e){
// grab form elements using jquery... i think there's a better way for this.
e.preventDefault();
var element = $(e.target);
var firstName = element.find("#firstName").val();
var lastName = element.find("#lastName").val();
var emailVal = element.find("#emailVal").val();
var companyVal = element.find("#companyVal").val();