Skip to content

Instantly share code, notes, and snippets.

View JamesVorder's full-sized avatar
☠️
yarrr

James Vorderbruggen JamesVorder

☠️
yarrr
View GitHub Profile
@JamesVorder
JamesVorder / Amazon_emr-6.0.0_Pyenv_bootstrap.sh
Last active March 23, 2020 19:07 — forked from mrthomaskim/install-Python-AmazonLinux-20171023.log
EMR bootstrapping script for Python 3.6.8 using Pyenv.
#!/bin/bash
### prerequisites
sudo yum groupinstall "Development Tools" -y
# git --version
# gcc --version
# bash --version
# python --version # (system)
sudo yum install @development zlib-devel bzip2 bzip2-devel readline-devel sqlite \
sqlite-devel openssl-devel xz xz-devel libffi-devel findutils -y
sudo yum update -y

Deployment Notes

valnet.lurker.dev

Basic Project Setup

Set Up Postgres DB

  • DB: valnet
  • User: valnetworker
  • Pass: v@1n3t

Update settings.py

Portin Requests

When a new customer would like to join our network with their existing number, we must do a Portin Request. The Portin Request is not the same thing as an activation. An activation is still required after doing a Portin Request. All that a Portin Request does is clear a number for use on the AT&T network.

Prerequisites

  1. Either the customer's account information (i.e. their account number and pin) from Sprint, OR
  2. Our Sprint account information

Steps to follow

New Device Activation

To follow along with these instructions, please log in to your staff account at test.phone.community/admin

These steps are NOT for port-in. Port-ins must be done separately.

Prerequisites

In order to activate a device on our network for the first time, you will need the following things:

Data Pool Optimization

m a t h

The sane allocation algorithm

import math

def allocate_data(plan_size, num_devices):

 if plan_size <= num_devices:
// ==UserScript==
// @name Second Page Automation
// @namespace http://tampermonkey.net/
// @version 1.2
// @description This script fills out the form based on what you enter below. It also checks for typos.
// @author nicknack
// @match *.blsspainvisa.com/*appointment.php
// @grant none
// ==/UserScript==
@JamesVorder
JamesVorder / OhBoy.cs
Created September 18, 2018 13:28
This is the single most complex method declaration I've made.
public static async Task<List<TTwo>> JoinEntities<TOne, TTwo>(string foreignKey, Query query, int maxResults = 250)
where TOne : IEntityModel, new() where TTwo: IEntityModel, new()
{
...
}
@JamesVorder
JamesVorder / Friend.sol
Last active March 21, 2018 19:58
FriendCoin ($FRND). A coin you can spend with your friends.
pragma solidity 0.4.21;
contract Token {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function totalSupply() public constant returns (uint256 supply);
function balanceOf(address _owner) public constant returns (uint256 balance);

Soma Cities

Programmatic strategy games could be a very interesting medium for tinkering with smart contracts. We can use solidity to implement the building blocks of a basic strategy game. In my implementation, these cities are fueled by state-subsidized labor and a drug called Soma.

Something profound. Aldous Huxley

Cities

  • Each city has citizens, cash, soma, and a utopia score determined by f(utopia) where f(utopia) = SOMETHING.
  • Each city can sellSoma(), levyTaxes(), importSoma(), and subsidizeWork().
  • Each of the above actions affects f(utopia) in some way.

Citizens

  • Each citizen has cash, soma, and a happiness score where f(happiness) = soma/cash + cash - soma
@JamesVorder
JamesVorder / addMessage.js
Last active March 18, 2018 22:59
A simple inbox smart contract and its implementation in JS. The contract will track locations in the swarm holding JSON formatted email data.
Web3 = require('web3');
web3 = new Web3(new Web3.providers.HttpProvider());
var addr = process.argv[2];
console.log("addr: " + addr + "\n");
console.log("Addr is valid? " + web3.isAddress(addr));
var message_location = process.argv[3];
console.log("message_location: " + message_location + "\n");
web3.eth.defaultAccount = web3.eth.accounts[0]