This file contains 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
contract Proxy { | |
modifier onlyOwner() { | |
address owner; | |
assembly { | |
owner := sload(0xfffffffffffffffffffffffffffffffffffffffe) | |
} | |
require(msg.sender == owner); | |
_; | |
} |
This file contains 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.5.0; | |
contract CertificateReg { | |
struct Certificate { | |
string name; | |
string course; | |
string date; | |
string instructor; | |
} |
This file contains 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.5.0; | |
library SafeMath { | |
function add(uint a, uint b) internal pure returns (uint c) { | |
c = a + b; | |
require(c >= a); | |
} | |
function sub(uint a, uint b) internal pure returns (uint c) { | |
require(b <= a); | |
c = a - b; |
This file contains 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
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account! | |
✅ did:muport:QmZHQddnrsKRNFMdZi5JE61Zbv2i62RtHAHYz9ep92DdFK ✅ | |
Create your profile today to start building social connection and trust online. https://3box.io/ |
This file contains 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.5.0; | |
contract HashCheckpoint { | |
mapping(address => bytes32) public checkpointHash; | |
event LogSuccess(bool registered); | |
function registerHash(bytes32 _latestHash) external { | |
checkpointHash[msg.sender] = _latestHash; |
This file contains 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 tqdm import trange | |
from time import sleep | |
import random | |
def main(): | |
n_people = int(input()) | |
iterations = int(input()) | |
print("\n\n\n") | |
matches = 0 | |
for _ in trange(iterations): |
This file contains 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
{ | |
"manifest_version": 2, | |
"name": "LinkedIn AdBlocker", | |
"description": "Blocking ads.", | |
"version": "0.0.1", | |
"author": "<AUTHOR_NAME>", | |
"browser_action": { | |
"default_title": "LinkedIn AdBlocker" | |
}, | |
"permissions": [ |
This file contains 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
/* | |
This event triggers when the browser has committed to loading a webpage. | |
As opposed to e.g. webNavigation.onCompleted, this will start to run early | |
so that we can begin to remove ads as soon as possible. | |
*/ | |
chrome.webNavigation.onCommitted.addListener(function (tab) { | |
// Prevents script from running when other frames load | |
if (tab.frameId == 0) { | |
chrome.tabs.query({ active: true, lastFocusedWindow: true }, tabs => { |
This file contains 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
function removeAds() { | |
// Get all 'span' elements on the page | |
let spans = document.getElementsByTagName("span"); | |
for (let i = 0; i < spans.length; ++i) { | |
// Check if they contain the text 'Promoted' | |
if (spans[i].innerHTML === "Promoted") { | |
// Get the div that wraps around the entire ad | |
let card = spans[i].closest(".feed-shared-update-v2"); |