Skip to content

Instantly share code, notes, and snippets.

View fechnert's full-sized avatar

Tim Fechner fechnert

  • Hornetsecurity
  • Hannover
View GitHub Profile
@notalentgeek
notalentgeek / pitch_volume_detection_pyaudio.py
Last active August 23, 2023 10:02
A simple proof of concept to extract pitch and volume of streamed audio from microphone with PyAudio.
# This is a simple demonstration on how to stream
# audio from microphone and then extract the pitch
# and volume directly with help of PyAudio and Aubio
# Python libraries. The PyAudio is used to interface
# the computer microphone. While the Aubio is used as
# a pitch detection object. There is also NumPy
# as well to convert format between PyAudio into
# the Aubio.
import aubio
import numpy as num
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active June 3, 2024 06:00
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@montanaflynn
montanaflynn / minimal.fish
Last active August 29, 2015 14:07
Remove noise from the terminal
#!/usr/bin/env fish
# Ubuntu Message of The Day
if test -f /etc/update-motd.d/*
chmod -x /etc/update-motd.d/*
end
# Fish Shell Greeting
set line1 "# Don't Show Fish Greeting"
set line2 "set --erase fish_greeting"
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//