Skip to content

Instantly share code, notes, and snippets.

// @pdxiii a nodejs solution using koajs.
// If your new to nodejs you should checkout Koajs.
// You can avoid callbacks in koajs, which makes life alot easier
// if your using Express or other, solution would be similar just using callbacks
// not really an emberjs guy, couldn't give you the details on how to do
// an HTTP Post but should be trivial to lookup
var koa = require('koa'),
route = require('koa-router'),
var Promise = require('bluebird');
var request = require('request');
/**
* Find the temperature at a location
* @param {String} location
* @param {function} callBack
* @return {Promise}
*/
var getTemperatureByLatLong = function(latitude, longitude, callBack){
var temp;
var Promise = require('bluebird');
var request = require('request');
/**
* Find the temperature at a location
* @param {String} zipcode
* @param {function} callBack
* @return {Promise}
*/
var findPopulationByZipCode = function(zipcode, callBack){
var temp;
@knowthen
knowthen / Main.elm
Created December 2, 2016 16:46
More Sophisticated Navigation Example
module Main exposing (..)
import Html exposing (text, div)
import UrlParser exposing (..)
-- UrlParser > elm package install evancz/url-parser -y
import Navigation exposing (..)
location : String -> Location
@knowthen
knowthen / DEVSETUP.md
Created February 22, 2017 16:50
Learn Functional Programming With Elm | Elm-lang Crash Course Dev Setup

Development Environment Setup Steps

  1. Install Recent Version of Nodejs by downloading and running the installer found at https://nodejs.org/en/ or use the Node Version Manager found at https://github.com/creationix/nvm
  2. Install Elm by keying the command npm install -g elm
  3. Install the atom editor located at https://atom.io/
  4. Install the language-elm using the atom package manager (apm), by keying the command apm install language-elm
  5. Install elm-oracle by keying npm install -g elm-oracle
  6. Determine the path where the elm-oracle command was installed by keying which elm-oracle on mac and unix or where.exe elm-oracle on windows. Copy the entire path and file name to the clipboard, for use in the next step
  7. Open up Atom, then open up the preferences/settings by pressing CMD + , (mac) or CTRL + , (windows) or via the menu. Click packages then filter by elm. Find the language-elm package and click the settings button. Set the elm-oracle setting, by pasting the
@knowthen
knowthen / Edit.png
Last active February 24, 2017 18:21
Valley Software Developers | Functional Programming Elm Meetup
Edit.png
@knowthen
knowthen / .git-prompt.sh
Created September 24, 2017 19:39
git prompt
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({65:[function(require,module,exports) {
"use strict";Object.defin
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({65:[function(require,module,exports) {
"use strict";Object.defin
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({25:[function(require,module,exports) {
function e(){this._events