Skip to content

Instantly share code, notes, and snippets.

@NoahMarconi
NoahMarconi / 4nyzer-out.txt
Created January 30, 2024 17:03
Bast Out of Scope Findings
# Report
## Gas Optimizations
| |Issue|Instances|
|-|:-|:-:|
| [GAS-1](#GAS-1) | Use `selfbalance()` instead of `address(this).balance` | 10 |
| [GAS-2](#GAS-2) | Use assembly to check for `address(0)` | 44 |
const MetaCoin = artifacts.require("MetaCoin");
const SafeMath = artifacts.require("SafeMath");
const mode = process.env.MODE;
let metaCoinInstance;
let safeMathInstance;
contract("MetaCoin", accounts => {
@NoahMarconi
NoahMarconi / 0_ABIExample.sol
Created June 27, 2018 14:38
ABI Encoder Examples
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract ABIExample {
enum Permission { ReadOnly, Write, Admin }
struct User {
uint256 id;
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract ABIExample {
enum Permission { ReadOnly, Write, Admin }
struct User {
uint256 id;
Verifying my Blockstack ID is secured with the address 133xJqzjTTm3wpNeMS34tfdFENYteAAB1z https://explorer.blockstack.org/address/133xJqzjTTm3wpNeMS34tfdFENYteAAB1z
@NoahMarconi
NoahMarconi / pageRank.scala
Last active September 20, 2016 18:20
Run Page Rank on Segments
import org.apache.spark.sql._
import org.apache.spark.sql.functions._
import org.graphframes._
// Load from shared location.
val nodes = spark.sqlContext.read.load("/mnt/hackondata/wattpadNodes.parquet")
val edges = spark.sqlContext.read.load("/mnt/hackondata/wattpadEdges.parquet")
// Filter graphs.
val gTotal = GraphFrame(nodes, edges)
@NoahMarconi
NoahMarconi / createFrame.scala
Last active September 20, 2016 18:19
Graphframe from JSON
import org.apache.spark.sql.functions._
// Construct nodes table.
val newColNames = List(
"age",
"gender",
"has_atleast_three_reading_lists",
"has_profile_picture",
"id",
"is_author",
# jdk8 setup
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
java -version
sudo apt-get install oracle-java8-set-default
wget http://downloads.lightbend.com/scala/2.11.8/scala-2.11.8.tgz
@NoahMarconi
NoahMarconi / run-r
Last active April 18, 2016 02:56
run-r handler for Hook.io R runtime.
#!/usr/bin/env r
#
# run-r handler for Hook.io R runtime.
#
# Copyright (C) 2016 Noah Marconi
#
# Released under MIT
doc <- "Usage: run-r [-c CODE] [-e ENVIRONMENT] [-s SERVICE]
@NoahMarconi
NoahMarconi / _.md
Last active August 29, 2015 14:10
Hexagon