Skip to content

Instantly share code, notes, and snippets.

@agconti
agconti / index.html
Created March 26, 2024 17:53
Demo html for ad
<html>
<body>
<div data-ad="true" class="reactive-embed" data-replay-id="ef3a1887-e996-4e85-8ab0-368fdab0327d"></div>
<script src="https://consumer-app-staging.reactive.live/bundle.js"></script>
</body>
</html>
@agconti
agconti / get-a-pgp-key-from-keybase.md
Last active March 22, 2024 15:33
A walkthrough on how to get a pgp key from keybase.

Get a PGP key from Keybase.

A walkthrough on how to get a pgp key from keybase.

Before you get started

  • Install pgp -- brew install gnupg

Create your keybase account

Go to keybase and create an account.

@agconti
agconti / example_locustfile.py
Last active May 5, 2022 00:49
Example Locustfile Keywords: Locustfile.py. Locust, LocistIo.
from locust import HttpLocust, TaskSet, task
class MostBasicLoadTest(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
self.login()
def login(self):
self.client.post("/api/api-token-auth/",
{

Keybase proof

I hereby claim:

  • I am agconti on github.
  • I am agconti (https://keybase.io/agconti) on keybase.
  • I have a public key whose fingerprint is F98C 1E59 630E F558 ED5B D1D2 62FD E34C 2634 4083

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am agcont on github.
  • I am agconti (https://keybase.io/agconti) on keybase.
  • I have a public key ASAN9ftsqV3LpV07itKj8wL7qBn2If5UwHOXvjFZVnhC4go

To claim this, I am signing this object:

@agconti
agconti / set-hosts.js
Created February 12, 2020 17:03
A script for pragmatically setting `/ect/hosts` with node.js
const { promisify } = require('util')
const { promises: fs } = require('fs')
const hostile = require('hostile')
const setHost = promisify(hostile.set)
const removeHost = promisify(hostile.remove)
const LOCALHOST = '127.0.0.1'
const hosts = [
[LOCALHOST, 'youralias'],
]
@agconti
agconti / Fib.py
Created December 30, 2019 16:29
A gentle intro to dynamic programming!
class Solution_recursive:
"""
Runtime: O(2^n)
Spacetime: O(1)
The classic approach to solving the Fibonacci sequence. The code is elegant but its runtime isn't
very pretty. Its recursive nature necessitates that we calculate some values of f(n) multiple times.
Consider this call graph where duplicated calls are denoted with `~`:
fib(7)
const http = require("http")
const getWeather = () => new Promise((resolve, reject) => {
const options = {
hostname: 'nodejs.org',
path: '/dist/index.json',
method: 'GET',
};
http.get(options, (res) => {
@agconti
agconti / fabfile.py
Last active January 29, 2019 11:10
Fabfile for django 1.7 + for easily deploying on heroku.
import os
import random
import string
from fabric.api import env, local, require, lcd
from fabric.colors import cyan
from fabric.operations import prompt
current_dir = os.getcwd()
env.project_name = '{{cookiecutter.app_name}}'