Skip to content

Instantly share code, notes, and snippets.

View beaugunderson's full-sized avatar
type type type

Beau Gunderson beaugunderson

type type type
View GitHub Profile
@rahuldamodar94
rahuldamodar94 / gist:6bdd022f3457934f2a104fd5f4bb45e4
Created December 16, 2020 02:21
0x V3 deployment on Matic Testnet (Mumbai - 80001) and Matic Mainnet (137)
"80001":{
"erc20Proxy": "0x0b47076aaa5246411458fcf85494f41bbfdb8470",
"erc721Proxy": "0xff7ca10af37178bdd056628ef42fd7f799fac77c",
"erc1155Proxy": "0x53d791f18155c211ff8b58671d0f7e9b50e596ad",
"zrxToken": "0x5af2b282779c7d4ffc69ca4e6e16676747f5c56b",
"etherToken": "0x5b5e11e4818cceba3e82ca9b97cd0ab80be75ad3",
"exchange": "0x533dc89624dcc012c7323b41f286bd2df478800b",
"erc20BridgeProxy": "0x5638a4b19f121adc4436de3f0e845173b33b594c",
"forwarder": "0x6dcf02d3a963f22dbf85c4025b86a834fef16c15",
"coordinatorRegistry": "0x6f5b9e0456c4849224c7b59dc15f05c48641c4e3",
@riobard
riobard / tcpdump.txt
Last active August 12, 2022 08:19
Poem lines broadcast by my ISP-provided fiber optical modem
# My ISP-provided fiber optical modem broadcasts a line of a poem every ten seconds. Here's the tcpdump of the complete poem.
# The optical modem is made by Shanghai Nokia-Bell Co.,Ltd and its model number is G-140W-UD. It's provided by my ISP, China Unicom in Shenzhen.
$ tcpdump -i vlan10 ether proto 0x8300
15:59:00.720301 00:00:00:00:00:12 (oui Ethernet) > Broadcast, ethertype Unknown (0x8300), length 72:
0x0000: 0000 0000 e4ea 8386 d93c 5468 6520 6461 .........<The.da
0x0010: 7920 4920 6c6f 7374 206d 7920 7665 7279 y.I.lost.my.very
0x0020: 2066 6972 7374 2074 6f6f 7468 2c00 0000 .first.tooth,...
0x0030: 0000 0000 0000 0000 0000 ..........
15:59:10.740778 00:00:00:00:00:12 (oui Ethernet) > Broadcast, ethertype Unknown (0x8300), length 72:
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@trutheum
trutheum / Trutheum.sol
Last active July 12, 2017 06:27
This is a preliminary test of Trutheum (trutheum.com)
pragma solidity ^0.4.13;
// Trutheum Contract v0.01
contract Trutheum {
// Contributer is any person who transfers funds
// to this contract. They have a right to vote for
// the truth that they believe answers the RFT.
struct Contributor {
uint weight;
bool voted;
@SimplGy
SimplGy / renameToHash.sh
Last active July 27, 2023 07:30
Rename files with a hash based on their contents. eg: `abc.jpg` to `3101ace8db9f.jpg`. Useful for detecting duplicates.
#!/bin/bash
# TODO: skip tiny files (so small they couldn't be photos)
# TODO: make sure sym links and other file system oddities are handled
# TODO: look at paralellization for perf boost
#
# Constants
#
CHAR_COUNT=12
BLOCK_COUNT=6
@airhadoken
airhadoken / twittercard.js
Last active February 4, 2022 18:41
Making twitter cards and also getting data back from them later, in NodeJS.
var T = require("twit");
var Q = require("q");
// key and secret for Twitter for iPhone.
// A whitelisted app is needed to access the cards API; you can't just create your own currently.
var TWITTER_CONSUMER_KEY = "IQKbtAYlXLripLGPWd0HUA";
var TWITTER_CONSUMER_SECRET = "GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU";
// These you will have to fill in yourself by authorizing Twitter for iPhone for your account.
// How to get the access tokens through OOB authorization is outside the scope of this snippet.
var TWITTER_ACCESS_TOKEN = "";
#!/usr/bin/env node
var inquirer = require("inquirer"),
request = require("request"),
qs = require('querystring'),
fs = require('fs');
var request_token_url = 'https://api.twitter.com/oauth/request_token',
access_token_url = 'https://api.twitter.com/oauth/access_token';
@trevnorris
trevnorris / all-my-knowledge.md
Last active December 9, 2017 00:39
Here's a rundown of everything I use to do performance analysis in Node.

Introduction

Here is a collection of tips and tricks I've picked up about doing performance analysis on Node. Included is a build script that should get a base install of Ubuntu fully functional and ready for all the things we'll be going through.

The script pulls a lot of code from the latest master of each repository. So it's possible that something may fail, but to date I haven't had any issues.

First, go ahead and run the script. Then go take a nice long break. It'll

@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
[{"index": 0, "id": "<redacted>", "habit": {"week": "2013-08-26", "goal_units": "timedelta", "daily_scores": [{"total_points": 128, "state": 13, "score": 1439, "goal": 720.0, "last_timestamp": "2013-08-26T23:59:00+5:00", "base_points": 25, "day": "monday"}, {"total_points": 125, "state": 13, "score": 1438, "goal": 720.0, "last_timestamp": "2013-08-27T23:59:00+5:00", "base_points": 25, "day": "tuesday"}, {"total_points": 125, "state": 13, "score": 1439, "goal": 720.0, "last_timestamp": "2013-08-28T23:59:00+5:00", "base_points": 25, "day": "wednesday"}, {"total_points": 125, "state": 13, "score": 1430, "goal": 720.0, "last_timestamp": "2013-08-29T23:59:00+5:00", "base_points": 25, "day": "thursday"}, {"total_points": 125, "state": 13, "score": 1440, "goal": 720.0, "last_timestamp": "2013-08-30T23:59:00+5:00", "base_points": 25, "day": "friday"}, {"total_points": 125, "state": 13, "score": 1434, "goal": 720.0, "last_timestamp": "2013-08-31T23:59:00+5:00", "base_points": 25, "day": "saturday"}, {"total_points": 1