Skip to content

Instantly share code, notes, and snippets.

View aaronferrucci's full-sized avatar

Aaron Ferrucci aaronferrucci

View GitHub Profile
xt255&! xt1{255&! & xt2{255&! & xt3{255&! &
yt255&! yt1{255&! & yt2{255&! & yt3{255&! &
x256<y256< &
& &
x255-255t-255&! x255-255t-1{255&! & x255-255t-2{255&! & x255-255t-3{255&! &
yt255&! yt1{255&! & yt2{255&! & yt3{255&! &
x255>y256< &
& &
|
xt255&! xt1{255&! & xt2{255&! & xt3{255&! &
xt32-1024&+xt32-1023&+1-&yt32-512&+yt32-511&+1-&&
0x-t48-512&+0x-t48-511&+1-&yt48-512&+yt48-511&+1-&&
x256<?
xt16-512&+xt16-511&+1-&0y-t16-512&+0y-t16-511&+1-&&
0x-t512&+0x-t511&+1-&0y-t512&+0y-t511&+1-&&
x256<?
y256<?
@aaronferrucci
aaronferrucci / scrape.pl
Created March 25, 2022 03:45
Scrape Santa Cruz median home price data from a website, output in csv format
use warnings;
use strict;
my @month_name = (
"",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
@aaronferrucci
aaronferrucci / crossproduct2.sv
Created February 16, 2021 02:42
Crossing Like A Boss
// https://fivethirtyeight.com/features/can-you-cross-like-a-boss/
//
// It’s the second week in our four weeks of CrossProduct™ puzzles!
// This time around, there are six three-digit numbers — each belongs in
// a row of the table below, with one digit per cell. The products of the
// three digits of each number are shown in the rightmost column. Meanwhile,
// the products of the digits in the hundreds, tens and ones places,
// respectively, are shown in the bottom row.
//
// a100 a10 a1 210
@aaronferrucci
aaronferrucci / crossproduct1.sv
Last active February 8, 2021 05:15
SystemVerilog constraint solution for 538 riddler express problem "cross product 1"
class CrossProduct1 #(
int R0 = 135,
int R1 = 45,
int R2 = 64,
int R3 = 280,
int R4 = 70,
int C0 = 3000,
int C1 = 3969,
int C2 = 640);
@aaronferrucci
aaronferrucci / dems.R
Last active January 20, 2020 06:16
plot democratic presidential elections, election year vs. candidate age
library(ggplot2)
library(scales) # for oob
winners <- data.frame(
candidate=c("Kennedy", "Kennedy", "Carter", "Clinton", "Clinton", "Obama", "Obama"),
age=c(43, 47, 52, 46, 50, 47, 51),
year=c(1960, 1964, 1976, 1992, 1996, 2008, 2012),
result=c("win")
)
losers <- data.frame(
@aaronferrucci
aaronferrucci / Makefile
Created December 8, 2019 03:36
examples of mp3 file tagging with id3v2, eyeD3
DEBUG := 0
ifeq ($(DEBUG),0)
ID3V2 := id3v2
EYED3 := eyeD3
else
ID3V2 := echo id3v2
EYED3 := echo eyeD3
endif
list:

Keybase proof

I hereby claim:

  • I am aaronferrucci on github.
  • I am aaronferrucci (https://keybase.io/aaronferrucci) on keybase.
  • I have a public key ASAEWWvJH6yZ2vT0XpkHErO88NY2lX7sf0YfZIV9sWLznAo

To claim this, I am signing this object:

@aaronferrucci
aaronferrucci / parabs.py
Created October 12, 2018 15:12
sympy exploration
from sympy import *
init_printing(use_unicode=True)
x, x1, x2 = symbols('x x1 x2')
f = x**2 + 1
g = -x**2 - 2*x - 1
df = diff(f, x)
dg = diff(g, x)
x2s = solve(df.subs(x, x1) - dg.subs(x, x2), x2)
x1s = solve((f.subs(x, x1) - g.subs(x, x2s[0])) / (x1 - x2s[0]) - df.subs(x, x1), x1)
x2s[0].subs(x1, x1s[0])
@aaronferrucci
aaronferrucci / EffluviumToken.sol
Created June 25, 2018 02:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.24;
/**
* Copied from Open Zeppelin https://github.com/OpenZeppelin/openzeppelin-solidity
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);