This file contains hidden or 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
const cmd = Ingredients.TextField.toLowerCase() | |
const supportedColors = [ | |
'white', 'red', 'orange', 'yellow', | |
'cyan', 'green', 'blue', 'purple', 'pink' | |
] | |
const skipAllBut = (exception:string)=> { | |
const msg = "Unknown command" | |
if (exception != 'color') Lifx.color.skip(msg) |
This file contains hidden or 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
// quotes by brainyquote.com | |
var data = [{"quote":"Life is 10% what happens to you and 90% how you react to it.","author":"Charles R. Swindoll"},{"quote":"Only I can change my life. No one can do it for me.","author":"Carol Burnett"},{"quote":"Infuse your life with action. Don't wait for it to happen. Make it happen. Make your own future. Make your own hope. Make your own love. And whatever your beliefs, honor your creator, not by passively waiting for grace to come down from upon high, but by doing what you can to make grace happen... yourself, right now, right down here on Earth.","author":"Bradley Whitford"},{"quote":"Optimism is the faith that leads to achievement. Nothing can be done without hope and confidence.","author":"Helen Keller"}] | |
var day = Meta.currentTime.day() | |
var wday = Meta.currentTime.format('dddd') | |
var msg = data[day]['quote'] + 'by ' + data[day]['author'] | |
IfNotifications.sendNotification.setMessage(msg) | |
EmailDigest.sendWeeklyEmail.setTitle(wday) | |
EmailDigest.sendWeeklyEmail.setMessage( |
This file contains hidden or 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
var txt = Ingredients.Text || "" | |
var price = parseInt((txt.match(/\s\$(\d+)\s/) || [])[1]) | |
if (price > 400) { | |
EmailDigest.sendDailyEmail.skip("Too expensive") | |
} |
This file contains hidden or 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
var hour = Meta.currentTime.hour() | |
var colorKey = hour.toString() | |
var colors: {[key:string]:string} = { | |
"17":"#F3F2EB", | |
"18":"#F7F2E6", | |
"19":"#F9EFE0", | |
"20":"#FBEFDC", | |
"21":"#FBE5C6", | |
"22":"#FBE5C6" |
This file contains hidden or 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
var colors = ["#FF8400", "#FF0000", "#15FF00", "#FF00D4","#00D4FF","#003CFF"] | |
var index = Math.floor((Math.random() * colors.length)) | |
Lifx.color.setAdvancedOptions('color: ' + colors[index] + '; brightness: 1; duration: 12') |
This file contains hidden or 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
ring, awair, something... |
This file contains hidden or 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
IFTTT_CHANNEL_KEY = "REPLACE_ME" | |
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "rails", "~> 5.0" | |
end | |
require "action_controller/railtie" |
This file contains hidden or 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
<activity android:name="your.package.name.to.DeepLinkActivity"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="yourscheme" android:host="yourhost" android:path="/yourpath"/> | |
</intent-filter> | |
</activity> |
This file contains hidden or 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
Uri uri = new Uri.Builder() | |
.scheme("https") | |
.authority("ifttt.com") | |
.appendPath("applets") | |
.appendPath("_YOUR_APPLET_ID_") | |
.appendPath("embed") | |
.appendQuery("redirect_uri", "yourscheme://yourhost/yourpath") | |
.build(); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
activity.startActivity(intent); |