View README.md

packaging an Electron app on windows, using "Node.js command prompt"

steps to reproduce:

  1. git clone https://github.com/deepak/electron-webview-todo/ && cd
  2. npm install
  3. npm install -g electron-forge
  4. npm run package:win32

packaging works on windows though:

View README.md

open the 'index.html' file in the browser. url will be like "file:///Users/deepak/Code/static/index.html#/"

this is possible because we use hashHistory and not browserHistory

need this in situations where - we use file based urls. we might need/prefer file based urls because:

  1. prototyping
  2. there is no server to serve html files. so no urls. although this is simple
View hack.js
const { ipcRenderer } = require('electron');
ipcRenderer.on('ping', () => {
console.log(document);
console.log(document.querySelector('input'));
// the document references to the document of the <webview>
document.querySelector('input').addEventListener('change', function(event) {
event.preventDefault();
console.log("====> test");
View # node@6 - 2016-12-26_16-24-30.txt
Homebrew build logs for node@6 on macOS 10.10.5
Build date: 2016-12-26 16:24:30
View elm-2-functions-diff.elm
-- Elm, what is the difference ?
\x y -> (x y) -- <function> : (a -> b) -> a -> b
\x y -> (x, y) -- <function> : a -> b -> ( a, b )
View gist:392dad0dd1f788471fae6eef16ac55a1
-- trying in elm-repl
import Random
type Msg = Foo Bool
r = (Random.generate Foo Random.bool)
-- { type = "leaf", home = "Random", value = Generate (Generator <function>) }
-- : Platform.Cmd.Cmd Repl.Msg
View trying-elm.elm
foo = 10
((-) foo 1)
((-) 1 foo)
-- derived type
-- cmd1 : a -> number
cmd1 = \op -> ((-) foo 1)
cmd1 (-1) -- 9
View elm-new.sh
function elm-new() {
mkdir -p $1
cd $1
# from https://github.com/github/gitignore/blob/master/Elm.gitignore
echo "# elm-package generated files
elm-stuff
# elm-repl generated files
repl-temp-*" > .gitignore
View validaitions-demo.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- These meta tags come first. -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>React Validation Demo</title>
View elm-type-annotation-for-arguments-and-return-type.elm
module Scratch exposing (..)
import String
-- arguments first then return
-- so the arguments are wrapped in braces for disambiguation
-- http://guide.elm-lang.org/types/reading_types.html