Skip to content

Instantly share code, notes, and snippets.

View Alex-CodeLab's full-sized avatar
💭
*writing code*

Alex Alex-CodeLab

💭
*writing code*
View GitHub Profile
from django.db import connection, reset_queries
from django.contrib.auth import get_user_model
User = get_user_model()
def perform_dummy_test(users):
for user in users:
groups = list(user.groups.all())
print('Queries performed:', len(connection.queries))
import timeit
import random
import numpy as np
import matplotlib.pyplot as plt
import bisect
# Function to calculate intersection using built-in set intersection
def intersection_set(set1, set2):
return set1.intersection(set2)
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<style>
body{
font-size: 80px;
letter-spacing: -16px;
line-height: 52px;
/*
config.h - compile time configuration
Part of Grbl
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
2018 - Bart Dring This file was modifed for use on the ESP32
CPU. Do not use this with Grbl for atMega328P
@Alex-CodeLab
Alex-CodeLab / gist:74cf7b784a5887583e351fd582f8fe59
Created July 18, 2018 20:14
Block crypto bots/sockpuppets
from time import sleep
import tweepy
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
@Alex-CodeLab
Alex-CodeLab / gist:e6243410cb463759d5b29fae24550f36
Created May 24, 2018 08:50
bitcoin ZMQ test check for dropped messages
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
modified for testing, detecting lost messages
Bitcoin should be started with the command line arguments:
@Alex-CodeLab
Alex-CodeLab / improved-lnd-bitcoind-install.md
Created May 17, 2018 11:26 — forked from bretton/improved-lnd-bitcoind-install.md
updated & improved guide to installing LND, Bitcoind, on Ubuntu 16.04 Server on testnet

2018-03-18: Updating of this guide is taking a backseat to the mainnet version at

Intro

This guide is specific to getting LND and bitcoind running on ubuntu 16.04 LTS for testnet.

It does not address mainnet, or using btcd, or neutrino.

Original installation guide: