This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the I2C Master | |
#include <Wire.h> | |
#define LED_PIN 13 | |
byte x = 0; | |
void setup() | |
{ | |
Wire.begin(); // Start I2C Bus as Master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$address = isset($_GET['address'])?$_GET['address']:null; | |
header("Access-Control-Allow-Origin: *"); | |
header("Content-type: application/json"); | |
function get_w1_address($address) | |
{ | |
$bus_addr = substr($address,0,2).'-'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function highlightSearchTerms(sword) { | |
$$('body').map(Element.extend).first().descendants().each(function (el) { | |
if (el.nodeType == Node.ELEMENT_NODE && el.tagName != 'TEXTAREA' && el.tagName != 'INPUT' && el.tagName != 'SCRIPT') { | |
$A(el.childNodes).each(function (onlyChild) { | |
var pos = onlyChild.textContent.indexOf(sword); | |
if (onlyChild.nodeType == Node.TEXT_NODE && pos >= 0) { | |
//console.log(onlyChild); | |
var spannode = document.createElement('span'); | |
spannode.className = 'highlight'; | |
var middlebit = onlyChild.splitText(pos); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Specify the product ID of your device | |
DEVICE="0x2838" | |
# the command to list USB devices | |
USB_DEVICE_CMD="system_profiler SPUSBDataType" | |
# get the list and filter for the device we're looking for | |
DEVICE_PRESENT=`$USB_DEVICE_CMD | grep $DEVICE | cut -f2 -d':'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal.h> | |
// tell the library which pins the LCD is connected on | |
LiquidCrystal lcd(12,11,10,5,4,3,2); | |
void setup() | |
{ | |
// initialize the serial port to 9600 baud (it's fast enough) | |
Serial.begin(9600); | |
// initialize the lcd to 16 columns, 2 rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use warnings; | |
chomp(my $status = `osascript -e 'tell application "iTunes" to player state as string'`); | |
if ($status eq 'playing') | |
{ | |
chomp(my $artist = `osascript -e 'tell application "iTunes" to artist of current track as string'`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************ | |
Version history | |
0.99.14 - Jan 12/2016 | |
Migrate to MQTT for notifications | |
0.99.13 - Jan 7/2016 | |
Add /temperature route to just return text/plain current temperature | |
0.99.12 - Jan 2/2016 | |
Add DS18B20 for temperature sensing and reporting | |
Use SPIFFS filesystem for hosting web assets | |
0.99.11 - Dec 25/2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ESP8266 with 20x4 i2c LCD | |
// Compatible with the Arduino IDE 1.6.4 | |
// Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library | |
// Bavensky :3 | |
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import untangle | |
doc = untangle.parse('/home/gpeverill/bryden.xml') | |
# use python's handy 'for item in list' syntax to traverse the list of Assets | |
for asset in doc.root.Dealership.Assets.Asset: | |
# save the VIN cdata value to a variable and print it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import urllib.request | |
import lxml.html | |
import untangle | |
import sys | |
def rchop(the_string, sub_str): | |
if (the_string.endswith(sub_str)): | |
return the_string[:-len(sub_str)] |
OlderNewer