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
repeat | |
tell application "System Events" to delay 3.0 | |
-- tell application "System Events" to set currentApp to name of first process where frontmost is true | |
if application "Spotify" is running then | |
try | |
-- Create a random number to do one of three things | |
set randomNum to random number from 1 to 3 | |
if randomNum is 1 then | |
tell application "Spotify" to pause |
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
--heres a even better one for a fake virus prank | |
tell application "Finder" | |
-- set x to ((path to me as text) & "Contents:Resources:appicon.icn*s") as | |
display dialog "Please read and agree to our Terms of Service (ToS). " buttons "OK" default button "OK" with title "iLivid Terms of Service" with icon 1 | |
set volume 10 | |
do shell script "say -v trinoids Virus activated" | |
display dialog "Virus propagating. |
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
set voiceList to {"Agnes", "Kathy", "Princess", "Vicki", "Victoria", "Bruce", "Fred", "Junior", "Ralph", "Albert", "Bad News", "Bahh", "Bells", "Boing", "Bubbles", "Cellos", "Deranged", "Good News", "Hysterical", "Pipe Organ", "Trinoids", "Whisper", "Zarvox"} | |
repeat | |
repeat with voice in voiceList | |
tell application "System Events" to delay 3.0 | |
tell application "Finder" to say "Clarice!" using voice | |
end repeat | |
end repeat |
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
// From http://stackoverflow.com/a/39344394/3984316 | |
import UIKit | |
extension String { | |
init(htmlEncodedString: String) { | |
self.init() | |
guard let encodedData = htmlEncodedString.data(using: .utf8) else { |
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
<!-- Put this in /etc/avahi/services/mosquitto.service --> | |
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> | |
<service-group> | |
<name replace-wildcards="yes">Mosquitto MQTT server on %h</name> | |
<service> | |
<type>_mqtt._tcp</type> | |
<port>1883</port> | |
<txt-record>info=Publish, Publish! Read all about it! mqtt.org</txt-record> | |
</service> |
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/env python | |
""" Example of announcing a service (in this case, a fake HTTP server) """ | |
import logging | |
import socket | |
import sys | |
from time import sleep | |
from zeroconf import ServiceInfo, Zeroconf |
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
interface LoginContracts { | |
interface View { | |
fun presentHomeScreen(user: User) | |
fun showError(message: String) | |
} | |
interface Presenter { | |
fun onDestroy() | |
fun onLoginButtonPressed(username: String, password: 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
interface LoginContracts { | |
interface View { | |
fun showError(message: String) | |
} | |
interface Presenter { | |
fun onDestroy() | |
fun onLoginButtonPressed(username: String, password: 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
class LoginContracts { | |
interface View { | |
fun showError(message: String) | |
//fun presentHomeScreen(user: User) <- This is no longer a part of the View's responsibilities | |
} | |
interface Router { | |
fun presentHomeScreen(user: User) // Now the router handles 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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME} | |
#end | |
#parse("File Header.java") | |
object ${NAME} { | |
interface View: BaseContracts.View { | |
//TODO | |
} | |
OlderNewer