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
module PouchDB where | |
import Task exposing (Task) | |
import Native.PouchDB | |
type PouchDB = POUCHDB_IMPLEMENTED_IN_JAVASCRIPT | |
type PouchError | |
= Error |
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
type alias RDoc a = { a | id : Int } | |
type alias RUser = RDoc { userName : String } | |
type alias RGroup = RDoc { groupName : String } | |
type RSelectedDoc | |
= RSelectedUser RUser | |
| RSelectedGroup RGroup | |
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
type Action | |
= StudentEdit Student.Student | |
| UnitEdit Unit.Unit | |
| StudentDeleteConfirm Student.Student | |
| StudentDeleteConfirmed Student.Student (Maybe Bool) | |
| StudentDeleted Student.Student (Result PouchDB.PouchError Bool) | |
| UnitDeleteConfirm Unit.Unit | |
| UnitDeleteConfirmed Unit.Unit (Maybe Bool) |
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
type alias Doc a = { a | id : Int } | |
type alias User = Doc { userName : String } | |
type alias Group = Doc { groupName : String } | |
user1 = { id = 1, userName = "dave" } | |
group1 = { id = 100, groupName = "some group" } | |
getIdFromDoc : Doc a -> Int |
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
update : Action -> Model -> (Model, Effects.Effects Action) | |
update action model = | |
case action of | |
-- This bit gets repeated again, and again, and again for every nested component. Why can't I abstract it? | |
StudentEditorAction studentEditorAction -> | |
let | |
(childModel, childEffects) = Components.Settings.StudentEditor.update studentEditorAction model.studentEditorModel | |
in | |
( { model | studentEditorModel = childModel } | |
, Effects.none) |
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
withSubmoduleUpdates : List String -> (a -> b) | |
withSubmoduleUpdates names update = | |
update |
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
-- PORT ERROR -------- ././app/assets/javascripts/Component/SchoolSearch/API.elm | |
This module has ports, but ports can only appear in the main module. | |
98| port theOutboundPort : Signal Value | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
Ports in library code would create hidden dependencies where importing a | |
module could bring in constraints not captured in the public API. Furthermore, | |
if the module is imported twice, do we send values out the port twice? |
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
module App (init, update, view, Action(StudentAction)) where | |
import Effects | |
import Html exposing (Html, text) | |
import Debug | |
import Student | |
import Components.StudentsPage | |
type Page |
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
Rx.Observable.prototype.sendToTimeline = function(name) { | |
const addToTimeline = (group, data, className) => { | |
items.add({ | |
start: new Date(), | |
content: stringify(data), | |
group: group.id, | |
className | |
}); | |
if (shouldFit) timeline.fit(); |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import AVFoundation | |
do { | |
let documentDirectoryURL = try! NSFileManager.defaultManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: true) | |
let outputURL = documentDirectoryURL.URLByAppendingPathComponent("output.mov") | |
if (NSFileManager.defaultManager().fileExistsAtPath(outputURL.path!)) { | |
try NSFileManager.defaultManager().removeItemAtPath(outputURL.path!) |