Skip to content

Instantly share code, notes, and snippets.

import Control.Monad.Except.Trans
import Data.HTTP.Method
import Network.HTTP.Affjax
import Network.HTTP.ResponseHeader
import Network.HTTP.StatusCode
import Prelude
import Control.Plus
import Control.Monad.Aff.Console (log)
import Control.Monad.Eff.Class (liftEff)
exports.create = function () {
var subs = [];
return {
event: function(sub) {
subs.push(sub);
},
push: function(a) {
return function() {
for (var i = 0; i < subs.length; i++) {
subs[i](a);
exports.inp1 = function(sub) {
var count = 0;
var b = document.querySelector("body");
b.addEventListener("click", function() {
sub(count + "");
count ++ ;
});
data Options = Local | Seasonal | LongDistance
foreign import showUI :: forall eff. (Option -> Eff eff Options)
main = do
options <- showUI Local
case options of
Local -> log "local"
Seasonal -> log "Seasonal"
LongDistance -> log "LongDistance"
module Main where
import Prelude
import Control.Monad.Eff.Class
import Network.HTTP.StatusCode
import Network.HTTP.Affjax as Ajax
import Control.Monad.Aff (Aff, Canceler(..), attempt, launchAff, makeAff)
import Control.Monad.Aff.Console (CONSOLE, log)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Exception ( Error, try)
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class
import Control.Monad.Aff (launchAff, Aff, makeAff, attempt)
import Control.Monad.Aff.Console (CONSOLE, log)
import Control.Monad.Eff.Exception (Error, try)
import Network.HTTP.Affjax as Ajax
import Network.HTTP.StatusCode
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Class
import Control.Monad.Aff (launchAff, Aff, makeAff, attempt)
import Control.Monad.Aff.Console (CONSOLE, log)
import Control.Monad.Eff.Exception (Error, try)
import Network.HTTP.Affjax as Ajax
import Data.Either (Either(..), either)
@knaman2609
knaman2609 / .jshintrc.js
Last active August 29, 2015 14:27 — forked from connor/.jshintrc.js
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@knaman2609
knaman2609 / gist:f4ddad6b451d2a61c981
Last active August 29, 2015 14:27 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
var ChatAppDispatcher = require('../dispatcher/ChatAppDispatcher');
var ChatConstants = require('../constants/ChatConstants');
var ChatMessageUtils = require('../utils/ChatMessageUtils');
var EventEmitter = require('events').EventEmitter;
var ThreadStore = require('../stores/ThreadStore');
var merge = require('react/lib/merge');
var ActionTypes = ChatConstants.ActionTypes;
var CHANGE_EVENT = 'change';