Skip to content

Instantly share code, notes, and snippets.

View mapio's full-sized avatar
🎯
Focusing

Massimo Santini mapio

🎯
Focusing
View GitHub Profile
@endolith
endolith / frequency_estimator.py
Last active October 30, 2023 18:08
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
@christophermanning
christophermanning / 50_top_paid_chicago_lobbyists.json
Last active April 2, 2022 21:28
Chicago Lobbyists Force-Directed Graph Visualization
{"links":[{"target":1,"source":0},{"target":2,"source":0},{"target":3,"source":0},{"target":4,"source":0},{"target":5,"source":0},{"target":6,"source":0},{"target":7,"source":0},{"target":8,"source":0},{"target":9,"source":0},{"target":10,"source":0},{"target":11,"source":0},{"target":12,"source":0},{"target":13,"source":0},{"target":14,"source":0},{"target":15,"source":0},{"target":16,"source":0},{"target":17,"value":22,"source":0},{"target":18,"value":24,"source":0},{"target":19,"value":28,"source":0},{"target":20,"value":19,"source":0},{"target":21,"value":19,"source":0},{"target":22,"value":26,"source":0},{"target":23,"value":28,"source":0},{"target":25,"source":24},{"target":26,"source":24},{"target":27,"source":24},{"target":28,"source":24},{"target":29,"source":24},{"target":30,"source":24},{"target":31,"source":24},{"target":32,"source":24},{"target":33,"source":24},{"target":34,"source":24},{"target":35,"value":1,"source":24},{"target":36,"value":12,"source":24},{"target":23,"value":1,"source":24},{"
{% extends 'admin/master.html' %}
{% import 'admin/lib.html' as lib with context %}
{% block body %}
{% call lib.form_tag() %}
{{ lib.render_form_fields(form) }}
<input type="submit" />
{% endcall %}
{% endblock %}
@willurd
willurd / web-servers.md
Last active April 18, 2024 14:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@aktau
aktau / imessage
Last active June 11, 2023 20:30
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
@omz
omz / Dropbox File Picker.py
Last active May 17, 2020 21:47
Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links
@jriguera
jriguera / delete-dockerhub-images.sh
Last active May 26, 2022 05:27
Delete Docker images on DockerHub
#!/bin/bash
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
@dongbohu
dongbohu / Free O'Reilly Books.md
Created September 14, 2017 15:25 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.