Skip to content

Instantly share code, notes, and snippets.

View yakkomajuri's full-sized avatar

Yakko Majuri yakkomajuri

View GitHub Profile
contract Proxy {
modifier onlyOwner() {
address owner;
assembly {
owner := sload(0xfffffffffffffffffffffffffffffffffffffffe)
}
require(msg.sender == owner);
_;
}
pragma solidity^0.5.0;
contract CertificateReg {
struct Certificate {
string name;
string course;
string date;
string instructor;
}
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;
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/
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;
<style>
#bannerimage {
/* Only mess with this if there is white on the sides - Can lead to scrolling to the left */
width: 103%;
background-image: url(YOUR URL HERE);
/* Play with this for a longer or shorter banner */
height: 600px;
@yakkomajuri
yakkomajuri / birthday_paradox.py
Last active April 20, 2020 23:00
Simple implementation of a program to explain the birthday paradox
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):
{
"manifest_version": 2,
"name": "LinkedIn AdBlocker",
"description": "Blocking ads.",
"version": "0.0.1",
"author": "<AUTHOR_NAME>",
"browser_action": {
"default_title": "LinkedIn AdBlocker"
},
"permissions": [
/*
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 => {
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");