This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
contract LinkedList { | |
bool public isEmpty = true; | |
uint public length = 0; | |
bytes32 public head; | |
bytes32 public tail; | |
struct LinkNode { | |
string value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference: https://radicalrafi.github.io/posts/homomorphic-encryption/ | |
// npm i --save big-integer | |
const bigInt = require('big-integer'); | |
const L = (x, n) => x.minus(1).divide(n); | |
function createEncryptor({ n, g }) { | |
return (m, r) => g.pow(m).times(r.pow(n)).mod(n.pow(2)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
contract GCDLCMCache { | |
mapping (bytes32 => uint256) public cache; | |
enum CacheType { GCD, LCM } | |
function gcd(uint256[] input) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma experimental ABIEncoderV2; | |
pragma solidity ^0.4.23; | |
contract BattleHash { | |
uint256 public numGames; | |
modifier validShot(uint256 gameId) { | |
Game storage game = games[gameId]; | |
address lastShooter = getLastShooter(game); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.24; | |
contract IdeaRegistry { | |
struct Idea { | |
address owner; | |
uint[] links; | |
} | |
mapping(uint => Idea) registry; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.24; | |
contract IdeaRegistry { | |
function registerIdea(uint hash) public; | |
} | |
contract IdeaValidator { | |
address owner; | |
address registryAddress; | |
mapping (address => bool) validators; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.11; | |
contract TaxAuthority { | |
address public owner; | |
mapping (address => uint) public taxesCollected; | |
modifier onlyOwner() { | |
require(msg.sender == owner); | |
_; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from network import Bluetooth | |
from network import LoRa | |
import socket | |
## CONSTANTS ## | |
# Increment this to setup more devices | |
VERSION = 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
set_environment: | |
outputs: | |
env_name: ${{ steps.setenv.outputs.env_name }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((_,[t,a],x=[3])=> | |
((z, ...w)=>t[t[a]`Y29uc29sZQ`][t[a]`bG9n`](z[t[a]`bWFw`](t[a]), ...w))`SQ${~~!''}YW0${x[0]}d2hhdA${x[~~'']}dGhleQ${x[~~""]+++x[~~``]++}Y2FsbA`)`${[this,((j,t)=>`${j[t]}t${j[-``]}`)`ob${1}a`]}` |