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
#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
#!/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
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
<?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
// This is the I2C Master | |
#include <Wire.h> | |
#define LED_PIN 13 | |
byte x = 0; | |
void setup() | |
{ | |
Wire.begin(); // Start I2C Bus as Master |
NewerOlder