Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
@SpotlightKid
SpotlightKid / rofi-selectfile.sh
Last active April 3, 2024 22:38 — forked from thingsiplay/selectfile
Use rofi to select file or folder until file is selected, then print it.
#!/usr/bin/env bash
#
# rofi-selectfile
#
# Use rofi to select file or folder until file is selected, then print it.
#
# Arguments
# $1=directory to start, defaults to "." (specified in variable default_dir)
#
# Adapted from: https://gist.github.com/thingsiplay/6c4bd13a106a4a609d69c402e675c137
@SpotlightKid
SpotlightKid / pthreads_cython.pyx
Last active December 4, 2022 18:59 — forked from jerryvig/pthreads_cython.pyx
Basic demonstration of how to use pthreads (POSIX threads) in Cython.
# cython: language_level=3, boundscheck=False
from cython.operator cimport dereference
from libc.stdio cimport printf
from posix.unistd cimport usleep
cdef extern from "pthread.h" nogil:
ctypedef int pthread_t
ctypedef struct pthread_attr_t:
pass
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
import time
from io import BytesIO
from os.path import join
from selenium import webdriver
@SpotlightKid
SpotlightKid / extscreenmanager.py
Last active October 24, 2017 19:28 — forked from rnixx/gist:2aab5e13e17c1582b6dd
Extended Screen Manager for kivy with better convenience for switching between screens.
# -*- coding: utf-8 -*-
"""Extended Screen Manager for kivy with better convenience for switching between screens."""
from six import string_types, iteritems
from kivy.logger import Logger
from kivy.uix.screenmanager import ScreenManager
from kivy.uix.screenmanager import ScreenManagerException
from kivy.uix.screenmanager import Screen
@SpotlightKid
SpotlightKid / rest-server.py
Last active May 12, 2016 00:39 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework (this fork is Python 3 compatible). See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
# coding=UTF-8
from __future__ import division
import nltk
from collections import Counter
# This is a simple tool for adding automatic hashtags into an article title
# Created by Shlomi Babluki
# Sep, 2013
@SpotlightKid
SpotlightKid / jdutil.py
Last active July 21, 2024 15:31 — forked from jiffyclub/jdutil.py
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
"""
@SpotlightKid
SpotlightKid / dspD8.ino
Created February 20, 2016 21:02 — forked from anonymous/dspD8.ino
The dsp-D8 drum synthesizer
// dsp-D8 Drum Chip (c) DSP Synthesizers 2015
// Free for non commercial use
// http://janostman.wordpress.com
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
// dsp-L8 Latin Perc Chip (c) DSP Synthesizers 2015
// Free for non commercial use
// http://janostman.wordpress.com
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
@SpotlightKid
SpotlightKid / O2.ino
Created February 20, 2016 20:53 — forked from anonymous/O2.ino
// O2 Minipops rhythm box (c) DSP Synthesizers 2016
// Free for non commercial use
// http://janostman.wordpress.com
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>