This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybtex.database.input import bibtex | |
from pybtex.database.output.bibtex import Writer | |
from pybtex.errors import set_strict_mode | |
import sys | |
if __name__ == '__main__': | |
if len(sys.argv) != 2: | |
print('usage: python3 detrashify_acm.py /path/to/acm.bib') | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// help from https://gist.github.com/wuct/b98f42dba91a8c08cc6ba2d820d94c1c | |
// | |
use std::sync::{Arc, Mutex}; | |
use std::thread; | |
fn acquire_lock(a: Arc<Mutex<i32>>, b: Arc<Mutex<i32>>) { | |
// note: if you do the commented out it doesn't deadlock, think about why that is | |
// let mut a_num = *a.lock().unwrap(); | |
// a_num += 1; | |
let mut a_num = a.lock().unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int main(int argc, char *argv[]) { | |
int dec; | |
scanf("%d", &dec); | |
// figure out bits needed to represent number | |
// 1. you can log(dec) base 2 or... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $# -ne 2 ]; then | |
echo "usage: ./monitor-mode.sh INTERFACE [on|off]" | |
exit 1 | |
fi | |
# if interface not exists | |
sudo iw dev $1 info > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo "unable to find device '$1'" | |
exit 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ID 1234:abcd Flipper Devices:Flipper Zero | |
REM run echo command | |
REM ---- open terminal (assuming shortcut is ctrl+alt+t) | |
DELAY 1000 | |
HOLD CTRL | |
HOLD ALT | |
STRING t | |
RELEASE CTRL | |
RELEASE ALT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.express as px | |
import pandas as pd | |
def variable_total_retrievals(): | |
df = pd.DataFrame(columns=['Name', 'Total Retrievals', 'Success Rate', 'Reputation']) | |
points = 10_000 | |
success_rates = 5 | |
for total_retrievals in range(0, 100_000, 50): | |
for i in range(success_rates): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: '2.0' | |
info: | |
description: This is the API for the Estuary application. | |
title: Estuary API | |
termsOfService: http://estuary.tech | |
contact: | |
name: API Support | |
url: https://docs.estuary.tech/feedback | |
license: | |
name: Apache 2.0 Apache-2.0 OR MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
estuary_set_auth() { | |
export APIKEY=$1 | |
} | |
estuary_create_collection() { | |
coluuid=$(curl -X POST -H "Authorization: Bearer $APIKEY" "http://localhost:3004/collections/" -d '{ "name": "A new collection", "description": "A new collection test" }' -s | jq | grep uuid | cut -d '"' -f 4) | |
export LAST_COLLECTION=$coluuid | |
echo $coluuid | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- announced CIDs to indexer | |
- CIDs queries from autoretrieve | |
- number of AR servers online | |
- how many heartbeats in the last day (kinda useless imo but...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APITOKEN="" # TODO: add your token here (create one: https://github.com/settings/tokens) | |
# be sure to check if the token hasn't expired! | |
# for ORG and TEAM, you can get those by navigating to your team on github | |
# and seeing the url, which will be in the format: | |
# https://github.com/orgs/{ORG}/teams/{TEAM}/discussions | |
# e.g. https://github.com/orgs/application-research/teams/a-team/discussions |
NewerOlder