Skip to content

Instantly share code, notes, and snippets.

View mjrulesamrat's full-sized avatar
🎯
Focusing

Jay Modi mjrulesamrat

🎯
Focusing
View GitHub Profile
Ursula - nucypher ursula run --dev --federated-only
Alice - nucypher alice run --dev --federated-only --teacher 127.0.0.1:10151
Bob - nucypher bob run --dev --federated-only --teacher 127.0.0.1:10151 --controller-port 4000
Enrico - nucypher enrico run --policy-encrypting-key <Key from Policy Creation> --http-port 5000
Create Policy -
POST
localhost:8151/derive_policy_encrypting_key/<Label>
@abelsonlive
abelsonlive / dbt_backfill.py
Created April 11, 2019 02:14
Script for backfilling DBT models which use partitions
#!/usr/bin/env python
import json
import copy
import sys
import argparse
from datetime import datetime, timedelta
from subprocess import Popen, PIPE
# dictionary of partiton names to variable generating functions
@gauravvjn
gauravvjn / admin.py
Last active August 17, 2023 20:27
Use JSONField properties in Django admin filter Raw
"""
More details on the implementation and usage can be found at
https://www.pyscoop.com/django-jsonfield-attributes-in-admin-filter/
"""
from django.contrib import admin
from django.core.exceptions import ImproperlyConfigured
class JSONFieldFilter(admin.SimpleListFilter):
@Geoyi
Geoyi / install virtualenv ubuntu 16.04.md
Created September 16, 2017 12:19 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@vasanthk
vasanthk / System Design.md
Last active April 24, 2024 17:22
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@yamionp
yamionp / locustfile.py
Last active March 21, 2024 22:56
Websocket Locust Sample. locustfile and Echo/Chat Server
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import json
import uuid
import time
import gevent
@sloria
sloria / bobp-python.md
Last active April 20, 2024 13:02
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream