Skip to content

Instantly share code, notes, and snippets.

## 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}"
#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
@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')
@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
#!/usr/bin/env bash
# export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
# ^^^ this can cause barfing and isn't needed
# Choose a condition for running WiFi Connect according to your use case:
# 1. Is there a default gateway?
# ip route | grep default
@libbymiller
libbymiller / gist:e3511c16d1590467171d9e157c6218b1
Last active January 29, 2019 17:51
Slackwobbler - anywhere - updated to new ArduinoJson and improved by Tim
/**
Arduino Real-Time Slack Bot
Copyright (C) 2016, Uri Shaked.
Licensed under the MIT License
https://github.com/urish/arduino-slack-bot
Bodged to use WiFiManager and a servo by libby.
#!/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 / screenshot.py
Last active April 19, 2018 12:01
e-ink chromium waveshare
import epd7in5
import Image
import ImageDraw
import ImageFont
EPD_WIDTH = 640
EPD_HEIGHT = 384
def main():
epd = epd7in5.EPD()
import flickrapi
import urllib
import json
import random
import filecmp
import shutil
import os.path
from pprint import pprint
api_key = u'your api key'