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
package fm.last.android; | |
public class PrivateAPIKey { | |
public static final String KEY = "{your API key}"; | |
public static final String SECRET = "{your API secret}"; | |
public static final String ANALYTICS_ID = ""; | |
} |
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
private boolean isLastFmInstalled() { | |
PackageManager pm = getPackageManager(); | |
boolean result = false; | |
try { | |
pm.getPackageInfo("fm.last.android", PackageManager.GET_ACTIVITIES); | |
result = true; | |
} catch (Exception e) { | |
result = false; | |
} | |
return result; |
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
Intent intent = new Intent ( Intent.ACTION_VIEW, Uri.parse("lastfm://artist/Radiohead/similarartists")); | |
startActivity( intent ); |
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
intent = new Intent( Intent.ACTION_VIEW ); | |
intent.setComponent(new ComponentName("fm.last.android","fm.last.android.activity.Metadata")); | |
intent.putExtra("artist", "The Postal Service"); | |
intent.putExtra("track", "Such Great Heights"); | |
startActivity( intent ); |
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
intent = new Intent( Intent.ACTION_VIEW ); | |
intent.setComponent(new ComponentName("fm.last.android","fm.last.android.activity.Tag")); | |
intent.putExtra("lastfm.artist", "The Postal Service"); | |
intent.putExtra("lastfm.track", "Such Great Heights"); | |
startActivity( intent ); |
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
-- ComputerCraft oil refinery controller | |
-- Alternates between two banks of combustion engines so the engines don't overheat and explode | |
function enableWire(color) -- Turn on a colored wire in the bundle without affecting the other colors | |
local currentSet = rs.getBundledOutput("back") | |
if not colors.test(currentSet, color) then | |
currentSet = colors.combine(currentSet, color) | |
rs.setBundledOutput("back", currentSet) | |
end | |
end |
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
-- Castle Gate Control | |
-- Opens and closes a redpower frame gate at the push of a button | |
local side = "left" -- Bundled cable location | |
local alarmSide = "back" -- Howler alarm location | |
function enableWire(color) -- Turn on a colored wire in the bundle without affecting the other colors | |
local currentSet = rs.getBundledOutput(side) | |
if not colors.test(currentSet, color) then | |
currentSet = colors.combine(currentSet, color) |
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
on push(title, message) | |
set APP_TOKEN to "..." | |
set USER_KEY to "..." | |
do shell script "curl -s -F token=" & APP_TOKEN & " -F user=" & USER_KEY & " -F title=\"" & title & "\" -F message=\"" & message & "\" https://api.pushover.net/1/messages.json" | |
return | |
end push | |
using terms from application "Messages" | |
on message received theMessage from theBuddy for theChat |
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
# User specific aliases and functions | |
RED="\[\033[31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_BLUE="\[\033[1;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" |
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
// Uses an Adafruit OLED on pins D0 - D6 for output, see http://www.adafruit.com/products/823 | |
/* LCD RS pin to digital pin 0 | |
* LCD R/W pin to digital pin 1 | |
* LCD Enable pin to digital pin 2 | |
* LCD D4 pin to digital pin 3 | |
* LCD D5 pin to digital pin 4 | |
* LCD D6 pin to digital pin 5 | |
* LCD D7 pin to digital pin 6 | |
*/ |
OlderNewer