Skip to content

Instantly share code, notes, and snippets.

View mcapodici's full-sized avatar

Martin Capodici mcapodici

View GitHub Profile
@mcapodici
mcapodici / Program.cs
Created July 26, 2015 21:00
List Monad implemented in C#
using System;
using System.Collections.Generic;
using System.Linq;
namespace Monad
{
class Program
{
static void Main(string[] args)
{
1. Install user CSS extension (or similar): https://chrome.google.com/webstore/detail/user-css/okpjlejfhacmgjkmknjhadmkdbcldfcb?hl=en
2. Apply the following style to news.ycombinator.com
.c00, .c00 a:link { color:#000000; }
.c5a, .c5a a:link, .c5a a:visited { color:#000000; }
.c73, .c73 a:link, .c73 a:visited { color:#000000; }
.c82, .c82 a:link, .c82 a:visited { color:#000000; }
.c88, .c88 a:link, .c88 a:visited { color:#000000; }
.c9c, .c9c a:link, .c9c a:visited { color:#000000; }
.cae, .cae a:link, .cae a:visited { color:#000000; }
@mcapodici
mcapodici / FreeCheapBS.md
Last active June 20, 2019 05:07
Excellent Free or V.Cheap tools ans services for bootstrapping a side project

This is a braindump of excellent tools & services that are free or really cheap that you can use to bootstrap something on the side.

I only include services with a generous enough free-tier plan that you can probably use it for a long time before needing to ugrade, reducing the pressure to make money from the beginning.

Email Services

Regular Email Service

  • Zoho: https://www.zoho.com/mail/ - offers a generious free tier that allows you to connect a single domain name, and a pretty decent user interface. They provide a catchall facility so you can receive emails on many different aliases.
@mcapodici
mcapodici / SimpleDPMPoolExample.ts
Created February 22, 2022 05:57
Simple implementation of a dynamic parimutuel market.
interface Bet {
who: string;
outcome: number; // 1 for A, 2 for B
shares: number; // Number of shares allocated
money: number; // Money placed for given shares
}
interface Pool {
initialMoney: number; // Initial pool
initialProb: number; // Initial probability
@mcapodici
mcapodici / run.py
Created April 10, 2023 02:06
IRIS Linear Regression using NumPy
import numpy as np
from numpy import genfromtxt
iris = genfromtxt("IRIS.csv", delimiter=",", skip_header=True)
training_examples = iris[:, list(range(3))]
targets = iris[:, -2]
bias_column = np.ones((training_examples.shape[0], 1))
inputs = np.hstack((bias_column, training_examples))
@mcapodici
mcapodici / train.py
Created April 18, 2023 22:49
Weightspace for perceptron training
# Based on https://www.cs.toronto.edu/~rgrosse/courses/csc321_2018/homeworks/hw2.pdf, 1. b.
import numpy
import pylab
import random
# Training Data
x = numpy.array([
[1, -2],
@mcapodici
mcapodici / autograd_vs_h2_q3.md
Created April 20, 2023 00:47
Using autograd to confirm answers to CSC321 Winter 2018, Hw2, Q3

Using autograd to confirm answers to CSC321 Winter 2018, Hw2, Q3

import torch
from torch.autograd import Variable
torch.manual_seed(0)
@mcapodici
mcapodici / torch_vs_hw3_q1.md
Created April 20, 2023 23:23
Using torch to confirm answers to CSC321 Winter 2018, Hw3, Q1
import torch
W1 = torch.tensor([[1,-1,0,0],[0,1,-1,0],[0,0,1,-1]])
W1
@mcapodici
mcapodici / compgraph.dot
Created April 21, 2023 05:45
Graphviz for CSC321 Winter 2018, Hw3, Q2
digraph G {
node [shape="none"]
rankdir="LR"
R [label=<𝓡>, fontcolor=blue]
S [label=<𝓢>, fontcolor=blue]
E [label=<𝓔>, fontcolor=darkgreen]
h [label=<<b>h</b>>, fontcolor=blue]

Certainly! I can help you understand how to use the get() function in Firestore security rules to make permissions dependent on data within another collection. Although I don't have the ability to share photos directly, I can guide you through the process step by step.

Let's assume you have a Firestore database structure as follows:

- parentCollection (collection)
  - documentA (document)
    - subCollectionX (collection)
      - subDocumentX (document)
 - documentB (document)