emoji extracted from: https://www.buzzfeed.com/nathanwpyle/20-emojis-every-texan-wish-existed
128x128 png: http://i.imgur.com/J7aWlvq.png
#!/usr/bin/env bash | |
: "${SLACK_API_TOKEN:?Need to set SLACK_API_TOKEN environment variable}" | |
STATUS=$(/usr/bin/osascript <<"EOF" | |
if application "Spotify" is running and application "Slack" is running then | |
tell application "Spotify" | |
set currentArtist to artist of current track as string | |
set currentSong to name of current track as string | |
return currentArtist & " - " & currentSong |
emoji extracted from: https://www.buzzfeed.com/nathanwpyle/20-emojis-every-texan-wish-existed
128x128 png: http://i.imgur.com/J7aWlvq.png
class MyClass: | |
def __init__(self, a, b, c): | |
self.value_1 = a | |
self.value_2 = b | |
self.value_3 = c | |
def __iter__(self): | |
""" enables dict(object) functionality """ | |
yield "key1", self.value_1 |
def identity_print(x): | |
print(x) | |
return x | |
echo_FP = lambda: identity_print(input("FP -- "))=='quit' or echo_FP() | |
echo_FP() |
assemblyMergeStrategy in assembly := { | |
case PathList("META-INF", xs @ _*) => MergeStrategy.discard | |
case _ => MergeStrategy.first | |
} |
docker stats $(docker ps --format={{.Names}}) |
import logging | |
logger = logging.getLogger() | |
handler = logging.StreamHandler() | |
formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s') | |
handler.setFormatter(formatter) | |
logger.addHandler(handler) | |
logger.setLevel(logging.DEBUG) | |
logger.debug("Testing, testing, 1, 2, 3") |
assemblyMergeStrategy in assembly := { | |
case x if Assembly.isConfigFile(x) => | |
MergeStrategy.concat | |
case PathList(ps @ _*) if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) => | |
MergeStrategy.rename | |
case PathList("META-INF", xs @ _*) => | |
xs map {_.toLowerCase} match { | |
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) => | |
MergeStrategy.discard | |
case ps @ (x :: xs) if ps.last.equals("pom.properties") || ps.last.equals("pom.xml") => |
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
license: gpl-3.0 |