Basic unit type:
λ> replTy "()"
() :: ()Basic functions:
Basic unit type:
λ> replTy "()"
() :: ()Basic functions:
| {-| Focus management is not a trivial task, but luckly most of it's logic can be fully self | |
| contained by principrals of Elm archituture. | |
| -} | |
| import Html exposing (Attribute, Html) | |
| import Html.Attributes exposing (attribute) | |
| import Html.Events | |
| import Setting exposing (setting) |
brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)$ gpg --gen-key$ vim ~/.gnupg/gpg-agent.conf
| // Button is a high level construct that can be used | |
| // to define button types with a specific behaviors | |
| let { Button } = require("sdk/ui"); | |
| // Button with specicic behavior can be defined by passing a function | |
| // defining a behaivor of a button on the specific state changes. | |
| var button = Button(function behavior(state, {owner}) { | |
| // First argument represents current `state` snapshot for the button | |
| // in the context of the given `options.owner` window. | |
| // This is in response to https://gist.github.com/Peeja/5284697. | |
| // Peeja wanted to know how to convert some callback-based code to functional | |
| // style using promises. | |
| var Promise = require('rsvp').Promise; | |
| var ids = [1,2,3,4,5,6]; | |
| // If this were synchronous, we'd simply write: |
| var obj = { | |
| _discoverScriptsAndSources: function TA__discoverScriptsAndSources() { | |
| let scriptsAdded = []; | |
| for (let s of this.dbg.findScripts()) { | |
| if (!this._allowSource(s.url)) { | |
| continue; | |
| } | |
| scriptsAdded.push(this._addScript(s)); |
| let { Cc, Ci } = require('chrome'); | |
| let appShellService = Cc['@mozilla.org/appshell/appShellService;1']. | |
| getService(Ci.nsIAppShellService); | |
| let service = Cc["@mozilla.org/observer-service;1"]. | |
| getService(Ci.nsIObserverService); | |
| let window = appShellService.hiddenDOMWindow; | |
| let document = window.document; | |
| let XUL = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' |
| var npm = require("npm") | |
| var path = require("path") | |
| npm.load({ prefix: path.join(process.env.HOME, ".orchestrator") }, function(e, npm) { | |
| npm.commands.ls([], function(err, _) { | |
| // this time it's nothing but probably results are cached | |
| npm.commands.install(["method"], function(err, _) { | |
| // now there is something but it still thinks there is nothing. | |
| npm.commands.ls([], console.log) | |
| }) |
| (function(exports) { | |
| // Simple, tiny, dumb module definitions for Browser JavaScript. | |
| // | |
| // What it does: | |
| // | |
| // * Tiny enough to include anywhere. Intended as a shim for delivering | |
| // browser builds of your library to folks who don't want to use script loaders. | |
| // * Exports modules to `__modules__`, a namespace on the global object. | |
| // This is an improvement over typical browser code, which pollutes the | |
| // global object. |