Skip to content

Instantly share code, notes, and snippets.

View Imundy's full-sized avatar

Ian mundy Imundy

View GitHub Profile
import csv
import random
# Represents a founder. this makes the simplified assumption of one founder per startup
class Founder:
def __init__(self, gender):
self.gender = gender
self.round = 'Seed'
self.funding = 0
self.amountRaised = 0
@Imundy
Imundy / AVAudioEngineExample.swift
Created December 28, 2017 02:52
An example of using AVAudioEngine
private var audioFiles: Array<String>
private var audioEngine: AVAudioEngine = AVAudioEngine()
private var mixer: AVAudioMixerNode = AVAudioMixerNode()
func Play() {
// do work in a background thread
DispatchQueue.global(qos: .background).async {
self.audioEngine.attach(self.mixer)
self.audioEngine.connect(self.mixer, to: self.audioEngine.outputNode, format: nil)
// !important - start the engine *before* setting up the player nodes
@Imundy
Imundy / decrypt-things.js
Created September 27, 2017 05:25
Decrypt a file using node-rsa
const NodeRSA = require('node-rsa');
const fs = require('fs');
export const decrypt = () => {
// Read in your private key from wherever you store it
const file = fs.readFileSync('/keys/private.pem', 'utf8');
const key = new NodeRSA();
key.importKey(file, 'pkcs1-pem');
const encrypted = fs.readFileSync(__dirname + '/encrypted-config', 'utf8');
@Imundy
Imundy / encrypt-things.js
Last active April 2, 2020 16:52
Generate an RSA key pair and encrypt a file
const NodeRSA = require('node-rsa');
const fs = require('fs');
const argv = require('minimist')(process.argv.slice(2));
const file = fs.readFileSync('data/' + argv.file, 'utf8');
const key = new NodeRSA().generateKeyPair();
const publicKey = key.exportKey('pkcs8-public-pem');
const privateKey = key.exportKey('pkcs1-pem');
@Imundy
Imundy / .babelrc
Last active September 15, 2017 17:30
Webpack Name Expected error
{
"presets": [
[
"env",
{
"targets": {
"browsers": [
"> 2% in US"
]
},