Skip to content

Instantly share code, notes, and snippets.

View giantmolecules's full-sized avatar
🧐

Brett Ian Balogh giantmolecules

🧐
  • The Laboratory for Artistic Research and Development
  • Chicago
View GitHub Profile
export TERM="xterm-color"
export PS1='☠️ \[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert country code here>
network={
ssid="<Name of your WiFi>"
psk="<Password for your WiFi>"
}
import requests
import csv
from bs4 import BeautifulSoup
# Establish a session.
session = requests.Session()
# Set up important headers.
session.headers.update({
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:72.0) Gecko/20100101 Firefox/72.0'
import pprint
import json
from googleapiclient.discovery import build
service = build("customsearch", "v1",
developerKey="DEVELOPER_KEY")
res = service.cse().list(
q='urinal',
searchType='image',
#include <Adafruit_NeoPixel.h>
#define PIN 0 // On Trinket or Gemma, suggest changing this to 1
#define NUMPIXELS 3 // Popular NeoPixel ring size
Adafruit_NeoPixel strip(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#include <Servo.h>
#define POT_PIN 0
Servo myServo;
int val = 0;
int servoSetPoint = 90;
int servoIncrement = 0;
int servoPosition = 90;
#include <Romi32U4.h>
#include <QTRSensors.h>
// This example is designed for use with eight QTR-1RC sensors or the eight sensors of a
// QTR-8RC module. These reflectance sensors should be connected to digital inputs 3 to 10.
// The QTR-8RC's emitter control pin (LEDON) can optionally be connected to digital pin 2,
// or you can leave it disconnected and change the EMITTER_PIN #define below from 2 to
// QTR_NO_EMITTER_PIN.
// The setup phase of this example calibrates the sensor for ten seconds and turns on
// This #include statement was automatically added by the Particle IDE.
#include <MQTT.h>
#include "Adafruit_Sensor.h"
#include "Adafruit_BME280.h"
#define AIO_SERVER "io.adafruit.com"
#define AIO_SERVERPORT 1883 // use 8883 for SSL
#define AIO_USERNAME ""
#define AIO_KEY ""
// This #include statement was automatically added by the Particle IDE.
#include <adafruit-drv2605-photon.h>
Adafruit_DRV2605 drv;
void setup() {
Serial.begin(9600);
Serial.println("DRV test");
drv.begin();
drv.selectLibrary(1);
// This program shows how to read the encoders on the Romi 32U4.
// The encoders can tell you how far, and in which direction each
// motor has turned.
//
// You can press button A on the Romi to drive both motors
// forward at full speed. You can press button C to drive both
// motors in reverse at full speed.
//
// Encoder counts are printed to the LCD and to the serial
// monitor.