This file contains hidden or 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
# note that it only measures processes that exist when measurement is started | |
import sys | |
import psutil | |
import pandas as pd | |
pd.set_option('display.max_colwidth', 200) |
This file contains hidden or 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
# Compare two .pstat files to find out what happened between the two snapshats | |
# call times from a are reduced by b | |
# this results profile that ignores every call that happed before b | |
# | |
# consider using yappi instead, as it works better with multithreading | |
# a - b | |
a = '/Users/me/Library/Caches/JetBrains/PyCharm2024.3/snapshots/jnb5.pstat' | |
b = '/Users/me/Library/Caches/JetBrains/PyCharm2024.3/snapshots/jnb4.pstat' |
This file contains hidden or 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
""" | |
Real-time IIR Notch filter. | |
It remembers the state on subsequent calls so it can filter frames of a signal stream. | |
Useful to filter e.g. 50 Hz or 60 Hz noise. | |
""" | |
from scipy import signal | |
This file contains hidden or 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
Export PCB 3d models https://github.com/easyw/kicadStepUpMod | |
KiCost | |
KiBot https://github.com/INTI-CMNB/KiBot?tab=readme-ov-file |
This file contains hidden or 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
for f in docs/img/*.png; do cwebp "$f" -q 70 -o "${f%.png}.webp" && rm $f; done |
This file contains hidden or 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
# initialize your client object as usual | |
influxdb_client = influxdb.InfluxDBClient(...) | |
# monkeypatch request function with a gzip wrapper | |
def _request_gzip(data, headers, **kwargs): | |
if headers is None: | |
headers = {} | |
if data: |
This file contains hidden or 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 "Halide.h" | |
//#include "Generator.h" | |
using namespace Halide; | |
using namespace Halide::Internal; | |
std::string compute_base_path(const std::string &output_dir, | |
const std::string &function_name, | |
const std::string &file_base_name) { | |
std::vector<std::string> namespaces; |
This file contains hidden or 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
<?php | |
$concurrency = 9; // how many "threads"? | |
if(empty($_GET['iframe'])) { | |
for($i = 0; $i < $concurrency; $i++) | |
echo "<iframe src='".$_SERVER['PHP_SELF']."?iframe=1'></iframe>"; | |
exit; | |
} |
This file contains hidden or 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
<?php | |
function disableOutputBuffer($dontPad = false) | |
{ | |
@ini_set('zlib.output_compression', 'Off'); | |
header('X-Accel-Buffering: no'); | |
ob_implicit_flush(true); | |
$levels = ob_get_level(); | |
for ( $i = 0; $i < $levels; $i ++ ) { | |
ob_end_flush(); |
This file contains hidden or 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 subprocess | |
import re | |
import datetime | |
import time | |
import sys | |
from select import select | |
def main(): | |
tStart = datetime.datetime.now() | |
eStart = getBatteryEnergy() |