Skip to content

Instantly share code, notes, and snippets.

@claymcleod
claymcleod / pycurses.py
Last active June 27, 2024 00:17
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
#! /usr/bin/python3
import struct
import sys
def to_int(l, signed=False):
ret = 0
for x in l[1:] if signed else l:
ret = (ret << 1) | x
if signed and l[0]:
@arantius
arantius / ingress-intel-notify-ui.user.js
Created December 7, 2012 04:45
User script for the Ingress Intel dashboard / notifier
// ==UserScript==
// @name Ingress Intel: Notify UI
// @namespace https://arantius.com/misc/greasemonkey/
// @description Annotate the Ingress Intel Dashboard with links to control the Ingress Notify app.
// @match http://www.ingress.com/intel*
// @version 1
// @grant none
// ==/UserScript==
//const NOTIFY_SERVER = 'http://localhost:8080/'
#Create a new issue in Jira from the Python XMLRPC interface. You'll have to
#provide the server and user credentials and match up your own fields
import sys
from xmlrpclib import Server
user = "username"
passwd = "passwd"
serverurl = "https://server.example.com/rpc/xmlrpc"
projectname = "demoproject"
@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