Skip to content

Instantly share code, notes, and snippets.

case class Car(Brand:String)
val tuple = ("this","is","a","tuple", 19, Car("Ford"))
// iterating over all items
tuple.productIterator.foreach(println)
/*
this
is
a
tuple
package tutorial.webapp
import scala.scalajs.js.JSApp
object TutorialApp extends JSApp {
def main(): Unit = {
println("Hello world!")
}
}
@emiaj
emiaj / bad1.js
Last active August 29, 2015 14:05
dotPsci instructions from "Purescript By Example" Book
dotPsci: ["src/**/*.purs", "bower_components/**/src/**/*.purs"]
// grunt verbose output
/*
Running "dotPsci" task
Running "dotPsci:0" (dotPsci) task
Verifying property dotPsci.0 exists in config...OK
Files: src/Chapter2/Chapter2.purs -> 0
Reading .psci...OK
{
"name": "playground",
"description": "An empty PureScript project.",
"keywords": [
"purescript"
],
"ignore": [
"**/.*",
"bower_components",
"node_modules",
@emiaj
emiaj / code
Created August 14, 2014 17:49
let isEven :: Number -> Boolean
let isEven 0 = false
let isEven 1 = false
let isEven 2 = true
let isEven n = isEven(n-1)
@emiaj
emiaj / index.js
Last active August 29, 2015 14:05
"use strict";
var Prelude = require("Prelude");
var Math = require("Math");
var isEven = function (__copy__36) {
var _36 = __copy__36;
tco: while (true) {
if (_36 === 0) {
return false;
};
if (_36 === 1) {
module Data.Experiments where
import Math
import Data.Array
import Control.MonadPlus
(..) :: Number -> Number -> [Number]
(..) = range
triples :: Number -> [[Number]]
triples n = do
@emiaj
emiaj / Experiments.purs
Last active August 29, 2015 14:05
>> Make failed: >> Error at src/Data/Experiments.purs line 9, column 20: >> Error in module Data.Experiments >> Unknown data constructor 'Directory'
module Data.Experiments where
import Data.Array
import Data.Foldable
import Data.Path
import FileOperations
onlyFiles :: Path -> [Path]
onlyFiles (Directory name paths) = []
onlyFiles _ = []
from busybox
VOLUME /var/shared
RUN touch /var/shared/placeholder
ENV NGINX_SERVICES_A_ADDRESS 10.0.0.2
ENV NGINX_SERVICES_A_NAME ServiceA
ENV NGINX_SERVICES_A_SHORTNAME a
ENV NGINX_SERVICES_B_ADDRESS 10.0.0.3
ENV NGINX_SERVICES_B_NAME ServiceB
ENV NGINX_SERVICES_B_SHORTNAME b