Skip to content

Instantly share code, notes, and snippets.

@zzzeek
zzzeek / asyncio_plus_greenlet.py
Last active July 5, 2023 16:32
An asyncio program that runs rows into a Postgresql database, using blocking style code to actually run the database commands
"""This program is exactly the same as that of
https://gist.github.com/zzzeek/33943060f7a08cf9e82bf8df1f0f75de ,
with the exception that the add_and_select_data function is written in
synchronous style.
UPDATED!! now includes refinements by @snaury and @Caselit . SIMPLER
AND FASTER!!
@allenyang79
allenyang79 / 00.md
Last active April 6, 2021 03:44
python ariadne usage

python ariadne usage

import os
import sys
import shutil
import multiprocessing as mp
from itertools import repeat as re
import dateparser
import pytz
import json
import csv
import datetime
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@rojcyk
rojcyk / blogpost.jsx
Last active July 16, 2021 14:14
Blog outpout styling
import React from 'react'
import RehypeReact from 'rehype-react'
/* Importing styled or react components */
import {
Headline1,
} from './content'
/* Mapping the components to the markdown output */
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 13, 2025 12:34 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@carlos8f
carlos8f / gist:b09a734cf626ffb9bb3bcb1ca35f3db4
Last active October 13, 2022 11:17
zenbot sim result, BTC-USD, 90 days, 195.45% profit, 61.06% over buy/hold
2017-05-11 16:00:00 1832.97 USD -0.06% 619.75 + 0.0447 null 1.91% 0.031060 BTC 2897.41 USD 195.43% +61.48%
{ days: 90,
profit_stop_enable_pct: 10,
profit_stop_pct: 1,
sell_rate: -0.006,
trend_ema: 36,
period: '1h',
strategy: 'trend_ema_rate',
sell_stop_pct: 4,
buy_stop_pct: 0,
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active March 1, 2025 08:27
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@tkreis
tkreis / transformUUDI.sql
Last active July 8, 2016 19:57
Transform base64 encoded id as uuid
CREATE OR REPLACE FUNCTION decode_uuid(encoded_uuid text) RETURNS uuid AS $$
BEGIN
RETURN uuid(encode(decode((encoded_uuid || '==') ,'base64'), 'hex'));
END;
$$ LANGUAGE plpgsql;
-- usage
SELECT * from ditto_entity where id = decode_uuid('mttF0tAFSbq1of1oFNfAJw');
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter