Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
version: '3' | |
services: | |
spark: | |
image: docker.io/bitnami/spark:2.4.5 | |
environment: | |
- SPARK_MODE=master | |
- SPARK_RPC_AUTHENTICATION_ENABLED=no | |
- SPARK_RPC_ENCRYPTION_ENABLED=no | |
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no | |
- SPARK_SSL_ENABLED=no |
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
--- | |
- hosts: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
var_name: "william" | |
var_port: "80" | |
tasks: |
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
// returns tagId | |
function asanaTagByName(tagName, token) { | |
var url = "https://app.asana.com/api/1.0/workspaces/2653227806782/typeahead?type=tag&query=" + encodeURIComponent(tagName); | |
var options = { | |
"muteHttpExceptions": true, | |
"method": "get", | |
"headers": { | |
"Authorization": "Bearer " + token | |
} |
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
import scala.annotation.tailrec | |
import scala.collection.mutable.{ArrayBuffer, Map} | |
import scala.util.Try | |
class HeapedMap[K, V] (implicit ord: Ordering[V]){ | |
val dict = Map[K,Int]() // Keeps index of key withing vector | |
val vector = ArrayBuffer[(K,V)]() | |
override def toString(): String = vector.toString | |
def toMap(): scala.collection.immutable.Map[K,V] = dict.mapValues(vector(_)._2).toMap |
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
var later = require('later'); | |
var timeString = "0 * * * *"; | |
function nextSchedule(cronTimeString, cont){ | |
var schedule = later.parse.cron(cronTimeString, true); | |
later.date.localTime() | |
var results = later.schedule(schedule).next(cont); | |
return(results); | |
} |
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/nodejs | |
var levelup = require('levelup'); | |
var http = require("http"); | |
var stream = require('stream'); | |
var util = require('util'); | |
var Transform = stream.Transform || require('readable-stream').Transform; | |
var server = http.createServer(onRequest); |