jq is useful to slice, filter, map and transform structured json data.
brew install jq
CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new
This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here
Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!
| #!/usr/bin/env bash | |
| # https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
| # https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
| # https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
| # https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
| # https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
| # https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
| # Versions | |
| CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` |
| @Test | |
| public void postMessage() | |
| { | |
| driver.get("https://csc510-fall16.slack.com/"); | |
| // Wait until page loads and we can see a sign in button. | |
| WebDriverWait wait = new WebDriverWait(driver, 30); | |
| wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("signin_btn"))); | |
| // Find email and password fields. |
| /** | |
| Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
| Your solution should be a link to a gist on gist.github.com with your implementation. | |
| When writing this code, you can use any language you're comfortable with. The code must be well tested and documented if necessary, and in general please treat the quality of the code as if it was ready to ship to production. | |
| Try to avoid using language defined methods like Ruby's Array#flatten.* | |
| */ | |
| 'use strict'; |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
| package Challenge3; | |
| public class DisplayItems { | |
| public static void main(String[] args) throws InvalidUnitsException, InvalidPriceException { | |
| RetailItem item1 = new RetailItem("Jacket", 12, 59.95); | |
| RetailItem item2 = new RetailItem("Designer Jeans", 20, 34.95); | |
| RetailItem item3 = new RetailItem("Shirt", 20, -24.95); | |
| System.out.printf("Item 1: %s\nUnits: %d\nPrice: %.2f\n" |
| <? | |
| ///////////////////// | |
| // slack2html | |
| // by @levelsio | |
| ///////////////////// | |
| // | |
| ///////////////////// | |
| // WHAT DOES THIS DO? | |
| ///////////////////// | |
| // |