It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
This file contains 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
import React, { Component } from 'react'; | |
import { render } from 'react-dom'; | |
import InputTrigger from 'react-input-trigger'; | |
class App extends Component { | |
constructor() { | |
this.state = { | |
top: null, | |
left: null, | |
showSuggestor: false, |
This file contains 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(sub_server). | |
-behaviour(gen_server). | |
-export([start_link/0]). | |
%% gen_server callbacks | |
-export([init/1, | |
handle_call/3, | |
handle_cast/2, |
This file contains 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 DragTable exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Json.Decode as Json exposing (Decoder, Value) | |
import Dict exposing (Dict) | |
import List as L exposing (drop, take) | |
import Tuple |
Should be work with 0.18
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
This file contains 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
sum : Tree Int -> Int | |
sum tree = | |
case tree of | |
Empty -> 0 | |
Node v left right -> | |
v + sum left + sum right | |
flatten : Tree a -> List a | |
flatten tree = | |
case tree of |
This file contains 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
// give it a name so it reuses the same window | |
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no"); | |
// reload in case it's reusing the same window with the old content | |
win.location.reload(); | |
// wait a little bit for it to reload, then render | |
setTimeout(function() { | |
React.render( | |
<DebugPanel top right bottom left > |
This file contains 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
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Based on initial version by Tom Isaacson (@parsley72).
Learn more about tracking geo coordinates in your own projects here.
NewerOlder