Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
@sixtenbe
sixtenbe / analytic_wfm.py
Last active February 24, 2024 23:45 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@jiffyclub
jiffyclub / jdutil.py
Created October 18, 2011 02:03
Functions for converting dates to/from JD and MJD
"""
Functions for converting dates to/from JD and MJD. Assumes dates are historical
dates, including the transition from the Julian calendar to the Gregorian
calendar in 1582. No support for proleptic Gregorian/Julian calendars.
:Author: Matt Davis
:Website: http://github.com/jiffyclub
"""
@arachsys
arachsys / README
Last active January 7, 2023 16:10
Yamaha YSFC file format
This content has moved to https://github.com/arachsys/motifxf/
@iurisilvio
iurisilvio / gist:4579043
Created January 20, 2013 14:26
Using bottle.ResourceManager to serve static files with `bottle.static_file`
import os
import bottle
# consider root folder with:
# path1/file1.txt
# path2/file2.txt
# path3/file3.txt
rm = bottle.ResourceManager()
// Datenbank anlegen
var request = indexedDB.open('html5', 1);
// Änderungs/Erzeugungs-Event
request.onupgradeneeded = function(){
console.log('Datenbank angelegt');
var db = this.result;
if(!db.objectStoreNames.contains('features')){
store = db.createObjectStore('features', {
keyPath: 'key',
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 29, 2024 09:05
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@tylerneylon
tylerneylon / learn.lua
Last active April 2, 2024 15:09
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@AWolf81
AWolf81 / DemoSettingsTPanel.py
Last active October 24, 2017 00:15
Settingspage inside of a TabbedPanel
from kivy.config import Config
Config.set('graphics', 'width', '320')
Config.set('graphics', 'height', '480')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.settings import SettingsWithNoMenu
from kivy.properties import StringProperty
@mplewis
mplewis / safe_schedule.py
Last active April 23, 2024 01:12
An implementation of Scheduler that catches jobs that fail. For use with https://github.com/dbader/schedule
import logging
from traceback import format_exc
import datetime
from schedule import Scheduler
logger = logging.getLogger('schedule')