Skip to content

Instantly share code, notes, and snippets.

View didmar's full-sized avatar

Didier Marin didmar

View GitHub Profile
@endolith
endolith / frequency_estimator.py
Last active July 15, 2024 21:25
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active July 25, 2024 03:38
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@sloria
sloria / bobp-python.md
Last active July 24, 2024 02:53
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
@suhailshergill
suhailshergill / RDDasMonadPlus.scala
Last active February 24, 2019 16:09
having monad instances for RDD like things
object RDDasMonadPlus {
import org.apache.spark.{ SparkContext }
import org.apache.spark.rdd.RDD
import scalaz._
import Scalaz._
import scala.reflect.ClassTag
// RDDMPlus is the type for which we will define the Monad instance. it can be
// constructed from an RDD using the RDDClassTag constructor. this
// implementation is based on insights from

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@ajorg-aws
ajorg-aws / s3cat.py
Last active August 16, 2023 16:24
Quick hack to upload stdin to S3.
#!/usr/bin/env python
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
from importlib import reload
from types import ModuleType
def rreload(module):
"""Recursively reload a module and all its submodules.
Graph DFS strategy modified from
https://stackoverflow.com/questions/15506971/recursive-version-of-reload
"""
visited = set()
def visit(m):
@gavrilov
gavrilov / readme.md
Last active June 18, 2024 18:33
Obsidian voice recognition with local Whisper model

Obsidian voice recognition with local Whisper model

Install plugin Whisper for Obsidian

plugin's settings: