Skip to content

Instantly share code, notes, and snippets.

@libbymiller
libbymiller / classification-image-ft-audio.py
Created April 9, 2019 20:32
Tensorflow image classifier with audio
#!/usr/bin/python
# coding=UTF8
# Copyright 2015 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@libbymiller
libbymiller / removeRTs.py
Last active July 19, 2019 12:13
Remove RTs from all friends on twitter (makes things calmer)
#https://stackoverflow.com/questions/9291122/api-twitter-api-attributeerror-module-object-has-no-attribute-api
#pip install python-twitter
import twitter
import time
api = twitter.Api(consumer_key='xxx',
consumer_secret='xxx',
access_token_key='xxx',
access_token_secret='xxx')
#include <Wire.h>
#include "Adafruit_TCS34725.h"
#include <Adafruit_NeoPixel.h>
//based on https://learn.adafruit.com/chameleon-scarf/overview?view=all#code
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream
## crontab
## * * * * * cd /opt/basictwitterbot; /usr/bin/ruby basictwitterbot.rb
## this is a fragment
def check_timeline_once(last_seen_id, client, channels, me, ls_full_path, dry_run)
opts = {}
opts[:include_entities] = true
puts "checking timeline with last seen id #{last_seen_id}"
@libbymiller
libbymiller / tumblr_soup.py
Created April 21, 2024 16:32
Bodgy beautifulsoup to create an index page for a tumblr site
from pathlib import Path
import re
from bs4 import BeautifulSoup
strs = []
path = "html"
mydir = Path(path)
soup_arr = []
soup2 = BeautifulSoup("""