Skip to content

Instantly share code, notes, and snippets.

let sortListsByLength l = sortBy (comparing length) l
sortListsByLength [[1,2],[1,2,3],[1,2,3,4]]
-- => [[1,2],[1,2,3],[1,2,3,4]]
cluster.name: catalog_search
node.name: "Catalog Master"
node.tag: query
bootstrap.mlockall: true
network.publish_host: 127.0.0.1
@novodinia
novodinia / test.js
Last active December 21, 2015 09:59
var MonitorCollection = function() {
family: "5c34";
maxResolution: {w: 1920, h:1080};
}
MonitorCollection.prototype.monitor1 = function() {
this.verticalRefresh = 60; //Hz
this.horizontalRefresh = 72; //Hz
this.wideMode = "off";
this.ddc = "off";

The code:

describe("When adding a car to favorites", function() {
  beforeEach(function() {
    var add_car_btn = element(by.id('add-car'));
    add_car_btn.click() // clicking the button sends the user to a new page with a table of cars
  })
  
  it("it should show up on the dashboard table", function() {

element.all(by.repeater('car in cars')).each(function(car) {

Prelude> do {
Prelude| y <- return 43
Prelude| x <- return 42
Prelude| putStrLn "hello"
Prelude| }
<interactive>:17:3: parse error on input `<-'
Prelude>
Prelude> :{
Prelude| let { x = 42 }
Prelude| let { y = 43 }
Prelude| :}
<interactive>:6:1: parse error on input `let'
Prelude> :{
Prelude| let { x = 42
Prelude| ; y = 43
Prelude| }
Prelude Web.Scotty Data.Monoid> :{
Prelude Web.Scotty Data.Monoid| scotty 3000 $ do {
Prelude Web.Scotty Data.Monoid| get "/:word" $ do {
Prelude Web.Scotty Data.Monoid| beam <- param "word"
Prelude Web.Scotty Data.Monoid| html $ mconcat ["<h1>Scotty, ", beam, "me up!</h1>"]
Prelude Web.Scotty Data.Monoid| }
Prelude Web.Scotty Data.Monoid| }
Prelude Web.Scotty Data.Monoid| :}
<interactive>:19:5:
-- foo1.hs
main = do
a <- readFile "bar.txt"
b <- lines a
return putStrLn b
{-
foo1.hs:3:8:
Couldn't match type `[]' with `IO'
Expected type: IO String
Actual type: [String]
@novodinia
novodinia / control-struct-defs.hs
Last active January 3, 2016 04:19
Cale explaining IO within #haskell
-- twice :: IO a -> IO (a,a)
twice x = do
u <- x
v <- x
return (u,v)
main = do
p <- twice getLine
print p
main = do
a <- readFile "bar.txt"
let b = lines a
putStrLn (show b)