a helpful primer for users sick of git's poorly-named commands
I've used Git since 2011, and this is the stuff that I've always had to Google to remember. I hope it helps you not hate Git so much.
use std::env; | |
use std::time::Duration; | |
use postgres::tls::openssl::OpenSsl; | |
use r2d2::{self, PooledConnection}; | |
use r2d2_postgres::{TlsMode, PostgresConnectionManager}; | |
use rocket::Request; | |
use rocket::request::{Outcome, FromRequest}; | |
use rocket::Outcome::{Success, Failure}; | |
use rocket::http::Status; |
Place the service file (or a link to it) in /etc/systemd/system/ Place the watchdogged.py file somewhere ( and change the ExecStart portion in the .service to point at the file )
then do systemctl daemon-reload
followed by systemctl start watchdogged.service
After this you can watch the progress using journalctl --follow -u watchdogged.service
change the PROBABILITY variable to something else to watch it faster/later or succeed.
module Dropdown where | |
import List exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick, onBlur) | |
-- MODEL |
import Graphics.Input.Field as Field exposing | |
(Content, noContent, field, defaultStyle, Direction) | |
import Graphics.Collage exposing (..) | |
import Maybe exposing (withDefault) | |
import Dict exposing (Dict) | |
import Graphics.Element as Elem exposing (..) | |
import Signal | |
import Color exposing (..) | |
import String | |
import Window |
import Graphics.Element exposing (show) | |
import Signal exposing (Address) | |
import Html exposing (Html, div, span, text, input) | |
import Html.Events exposing (on, targetValue) | |
import Html.Attributes exposing (value, style) | |
import Maybe | |
import StartApp | |
--------------------------- | |
main = |
-- inspired by: https://groups.google.com/d/msg/elm-discuss/2LxEUVe0UBo/ZgJ_ldUH6ygJ | |
-- thanks for the help: http://learnyouahaskell.com/functors-applicative-functors-and-monoids | |
module UserDecoder where | |
import Date exposing (Date) | |
import User exposing (User) | |
import Json.Decode as Js exposing ((:=)) | |
-- Applicative's `pure`: |
Max Goldstein | July 30, 2015 | Elm 0.15.1
In Elm, signals always have a data source associated with them. Window.dimensions
is exactly what you think it is, and you can't send your own events on it. You can derive your own signals from these primitives using map
, filter
, and merge
, but the timing of events is beyond your control.
This becomes a problem when you try to add UI elements. We want to be able to add checkboxes and dropdown menus, and to receive the current state of these elements as a signal. So how do we do that?
import Html exposing (Html, Attribute) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address) | |
import List | |
import String | |
import StartApp | |
------------------ | |
--- HELPER CODE -- |
-------------------------- | |
-- CORE LIBRARY IMPORTS -- | |
-------------------------- | |
import Task exposing (Task, ThreadID, andThen, sequence, succeed, spawn) | |
import Json.Decode exposing (Decoder, list, int, string, (:=), map, object2) | |
import Signal exposing (Signal, Mailbox, mailbox, send) | |
import List | |
--------------------------------- | |
-- THIRD PARTY LIBRARY IMPORTS -- |