Skip to content

Instantly share code, notes, and snippets.

View mcapodici's full-sized avatar

Martin Capodici mcapodici

View GitHub Profile
@mcapodici
mcapodici / lob.py
Last active July 27, 2023 06:51
modal local code runner script
import sys
import modal
import os
# Script to run your local code
#
# * Requires python package modal-client install, and you have obtained a token, e.g.:
# ```
# pip install modal-client
# modal token new
@mcapodici
mcapodici / gist:f0676eb8da3e801f41bb28cd9c1d9c84
Created June 18, 2023 07:30
Hacker New Discussion Text For Training Nano GPT
wpietri 6 days ago | next [–]
Great! There's a picket line I won't be crossing. Not just for those subs, of course, but for all of Reddit.
The reason Reddit is valuable is not the few execs making these (IMHO terrible) decisions. It's the thousands of mods and the millions of people creating and organizing the content that I go there to read. Until those people are happy with things, I'm not going back.
reply
jcims 6 days ago | parent | next [–]

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)
@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]
@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 / 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 / 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 / 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 / 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 / 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.