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 { IncomingWebhook } = require('@slack/client'); | |
// Needs to be run on Node 8.10 or later. | |
exports.handler = async (event) => { | |
// Could pass this through an environment variable | |
// so it's usable across different slack webhooks. | |
const URL = "https://hooks.slack.com/services/<YOUR_WEBHOOK_URL>"; | |
const webhook = new IncomingWebhook(URL); | |
let location; |
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
FROM alpine:latest | |
RUN apk update && apk add quassel-core sqlite qt-sqlite | |
EXPOSE 4242 | |
ENTRYPOINT ["quasselcore", "--configdir=/var/lib/quassel"] |
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
FROM ubuntu:latest | |
RUN apt-get update && apt-get -y install quassel-core | |
EXPOSE 4242 | |
ENTRYPOINT ['quasselcore', '--configdir=/var/lib/quassel'] |
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
async function api() { | |
const res = await fetch('/api/2.0/guides'); | |
return res.json(); | |
} | |
function *api() { | |
const res = yield fetch('/api/2.0/guides'); | |
return res.json(); |
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
async function api() { | |
const res = await fetch("/api/2.0/guides"); | |
const json = await res.json(); | |
return json | |
} | |
async function getGuides() { | |
let results = []; | |
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
function *example() { | |
const first = yield 1; | |
const second = yield 2; | |
console.log(first); | |
console.log(second); | |
} | |
const gen = example(); |
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
;; I remember racket having something like this, where you'd magically | |
;; have accessor functions defined for any structs you defined. | |
;; | |
;; I thought it might be fun to recreate that in Clojure after getting | |
;; through Ch. 9 Macros in Clojure for the Brave and True. | |
(defmacro defstruct | |
"Defines a struct type and accessor functions for its fields" | |
[name & field-params] | |
`(do |
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
(defn upgradeToVector [x] (if (vector? x) x (vector x))) | |
(defn makeParams [paramStr] (.split paramStr "&")) | |
(defn makePairs [param] | |
(let [[key value] (.split param "=")] | |
(vector key value))) | |
(defn parseParamString [paramStr] | |
(reduce (fn [result [key value]] | |
(if (contains? result key) |
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
/** | |
* Consumes a Cheerio Element and returns a function that | |
* consumes a category guid and returns the text value associated with it. | |
*/ | |
const getStatNameFromDropdown = compose(curry(guidToText), cheerio); | |
/** | |
* Given a container element, grab all career stats data from its children. | |
* @param {Cheerio Element} playtypeContainer | |
*/ |
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
/** | |
* Consumes a Cheerio Element and returns a function that | |
* consumes a category guid and returns the text value associated with it. | |
*/ | |
const getStatNameFromDropdown = compose(curry(guidToText), cheerio); | |
/** | |
* Given a container element, grab all top hero stats data from its children. | |
* @param {Cheerio Element} playtypeContainer Can either be the quickplay or competitive container. | |
*/ |