Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
💻
Making things!

Andy Piper andypiper

💻
Making things!
View GitHub Profile
@andypiper
andypiper / webfinger
Last active March 18, 2024 23:01 — forked from AaronNGray/webfinger
#!/bin/bash
# webfinger (macOS)
# needs GNU getopt since macOS doesn't support relevant options
# and jq - use `brew install gnu-getopt jq`
if [ ! `which jq` ]
then
echo Installing 'jq'
brew install jq
fi
@andypiper
andypiper / post
Created January 2, 2023 19:32 — forked from edsu/post
#!/bin/bash
# Set these environment variables and you can create a (text-only) post using
# your favorite command line text editor.
#
# - EDITOR: e.g. vim, emacs, etc
# - MASTODON_POST_HOST: the hostname for our Mastodon account, e.g. chaos.social
# - MASTODON_POST_TOKEN: an app access key with write:statuses permission
#
# See: https://gist.github.com/edsu/aa6f70bb20127b1e18e05dff5e470022
@andypiper
andypiper / rc2014.md
Created April 12, 2022 21:26 — forked from jblang/rc2014.md
RC2014 Links
@andypiper
andypiper / temp-check.py
Created March 21, 2022 14:18 — forked from lesp/temp-check.py
Using a BME688 Temperature sensor with Pimoroni's Badger 2040. Code is based on the BME688 example, but with added Badger 2040 code.
"""BME688 / BME680 demo
This demo will work for both the BME680 and BME688.
"""
import time
from breakout_bme68x import BreakoutBME68X, STATUS_HEATER_STABLE
from pimoroni_i2c import PimoroniI2C
import badger2040
import machine
badger = badger2040.Badger2040()
@andypiper
andypiper / twitter_collection_examples.py
Created June 19, 2020 15:46 — forked from fratamico/twitter_collection_examples.py
Creating a Twitter Collection via API
import json
from requests_oauthlib import OAuth1Session
# For a blog post describing this process more, see:
# https://medium.com/analytics-vidhya/creating-a-twitter-collection-via-api-1378ecfe20df
api_key = 'your api key'
api_secret_key = 'your api secret key'
access_token = 'your access token'
@andypiper
andypiper / twit_twurl.sh
Last active December 16, 2019 14:06 — forked from shapeshed/twit_twurl.sh
Tweet from the command line using twurl & OAuth
################################
#!/usr/bin/env bash
# File: twit_twurl.sh
# Description: Tweet from the command line using twurl & OAuth
#
# Copyright 2010 George Ornbo (Shape Shed)
#
# 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
@andypiper
andypiper / random_followers.py
Created January 25, 2018 16:45 — forked from aparrish/random_followers.py
random sample of twitter followers for a given screen name
# return a random sample of your twitter followers
# run like so:
# $ python random_followers.py <screen_name>
# where <screen_name> is the account you want followers for
import sys, random, json, urllib
sname = sys.argv[1]
ids_raw = urllib.urlopen(
"https://api.twitter.com/1/followers/ids.json?screen_name="+sname).read()
@andypiper
andypiper / workshop.rb
Last active April 9, 2016 07:36 — forked from brndnblck/workshop.rb
Twitter Ads API Getting Started (Ruby)
# enable "sandbox" mode
CLIENT.options[:sandbox] = true
# load your sandbox account object
account = CLIENT.accounts.first
# create your campaign
campaign = TwitterAds::Campaign.new(account)
campaign.funding_instrument_id = account.funding_instruments.first.id
campaign.daily_budget_amount_local_micro = 1_000_000
@andypiper
andypiper / README.md
Created February 20, 2012 18:01 — forked from bergie/README.md
MQTT pub/sub example

This is a simple example of the MQTT protocol with Node.js. The client code has also been tested with a combination of C++ servers and clients.

@andypiper
andypiper / Nanode_Tiny_Bas_Temp
Created February 10, 2012 22:16 — forked from anonymous/Nanode_Tiny_Bas_Temp
Nanode Tiny Basic with temperature sensing by @ceejay
// TinyBASIC.cpp : An implementation of TinyBASIC in C
//
// Author : Mike Field - hamster@snap.net.nz
//
// Based on TinyBasic for 68000, by Gordon Brandly
// (see http://members.shaw.ca/gbrandly/68ktinyb.html)
//
// which itself was Derived from Palo Alto Tiny BASIC as
// published in the May 1976 issue of Dr. Dobb's Journal.
//