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
using terms from application "Messages" | |
on message received theMessage from theBuddy for theChat | |
set buddyId to id of theBuddy as text | |
if (makelower(theMessage) begins with "todo:") then | |
set trim1 to trim_line(theMessage, "todo:", 0) | |
set trim2 to trim_line(trim1, " ", 0) | |
tell application "Things 2" | |
set newToDo to make new to do ¬ | |
with properties {name:trim2, notes:"From: " & buddyId} |
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
package com.proceranetworks.psm.leasepoller | |
package twpoller | |
import java.net.InetAddress | |
import java.nio.ByteBuffer | |
object ByteBufferImplicits { | |
implicit def byteBuffer2PimpedByteBuffer(buffer: ByteBuffer): PimpedByteBuffer = new PimpedByteBuffer(buffer) | |
} | |
class PimpedByteBuffer(buffer: ByteBuffer) { |
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
def union[A](a: Set[A], b: Set[A]) { | |
var c = b | |
for(item <- a) { | |
c += item | |
} | |
c | |
} | |
OR: |
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
package cisconacpoller | |
import scala.util.matching.Regex | |
trait Response | |
case class FailResponse(reason: String) extends Response | |
object NoSuchUserFailure extends FailResponse("No logged in user matches the criteria") | |
object InvalidCredentialsFailure extends FailResponse("Username or password is incorrect") |
NewerOlder