Skip to content

Instantly share code, notes, and snippets.

View jeffmarshall's full-sized avatar

Jeff Marshall jeffmarshall

View GitHub Profile
@jeffmarshall
jeffmarshall / countries.json
Created September 30, 2016 17:01 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
{"mapping":{"actionLink":"item['data','url']","profileImage":"item[\"data\",\"thumbnail\"]","descriptionTitle":"item[\"data\",\"name\"]","descriptionBody":"item[\"data\",\"domain\"]","footerCaption":"item[\"data\",\"subreddit\"]"},"title":"Raddit","type":"stream","template":"Temp_4","endpoint":"https://www.reddit.com/.json","pathToMainArray":"api['data','children']","createdAt":"2015-09-17T18:02:15.390Z","source":"TITLE = \"Raddit\",\r\nICON_URL = \"\",\r\nSUMMARY = \"\",\r\nCREATED_BY = \"Jeff Marshall\",\r\nGITHUB_ID = \"\",\r\nCREDITS = \"\",\r\nSETTINGS_TYPE = \"NONE\",\r\nPREVIEW_IMG= \"\",\r\nPREVIEW_TITLE= \"Some Template Title\"\r\n\r\n\r\nLOAD {\r\n\r\n var url = \"https://www.reddit.com/.json\"\r\n\r\n var location = APP.location\r\n\r\n var actualURL = url.replace(\"{lat}\",location.latitude).replace(\"{lng}\",location.longitude)\r\n\r\n var api = get(actualURL)\r\n\r\n return api['data','children'].loop {\r\n item in\r\n\r\n return [\r\n [\r\n
{"mapping":{"actionLink":null,"profileImage":null,"descriptionTitle":null,"descriptionBody":null,"footerCaption":null},"title":"nightmares","type":"single","template":"Temp_4","endpoint":"http://api.openweathermap.org/data/2.5/weather?q=montreal","createdAt":"2015-09-11T19:23:35.095Z","source":"TITLE = \"nightmares\",\r\nICON_URL = \"\",\r\nSUMMARY = \"\",\r\nCREATED_BY = \"Jeff Marshall\",\r\nGITHUB_ID = \"\",\r\nCREDITS = \"\",\r\nSETTINGS_TYPE = \"NONE\",\r\nPREVIEW_IMG= \"\",\r\nPREVIEW_TITLE= \"Some Template Title\"\r\n\r\n\r\nLOAD {\r\n\r\n var url = \"http://api.openweathermap.org/data/2.5/weather?q=montreal\"\r\n\r\n var location = APP.location\r\n\r\n var actualURL = url.replace(\"{lat}\",location.latitude).replace(\"{lng}\",location.longitude)\r\n\r\n var api = get(actualURL)\r\n\r\n return [[\r\n [\r\n \"actions\":[\r\n [\r\n \"icon\":\"source-icon\",\r\n \"function\":APP.webview(null)\r\n ]\r\n ]\r\n
{"mapping":{"actionLink":null,"bannerImage":null,"bannerTitle":null,"bannerCaption":null,"profileImage":null,"profileCaption":null},"title":"seth rogn","type":"single","template":"Temp_1","endpoint":"http://api.openweathermap.org/data/2.5/weather?q=montreal","createdAt":"2015-09-04T20:55:30.046Z","source":"TITLE = \"seth rogn\",\r\nICON_URL = \"\",\r\nSUMMARY = \"\",\r\nCREATED_BY = \"Jeff Marshall\",\r\nGITHUB_ID = \"\",\r\nCREDITS = \"\",\r\nSETTINGS_TYPE = \"NONE\"\r\nPREVIEW_IMG= \"\"\r\nPREVIEW_TITLE= \"Some Template Title\"\r\n\r\n\r\nLOAD {\r\n\r\n var url = \"http://api.openweathermap.org/data/2.5/weather?q=montreal\"\r\n\r\n var location = APP.location\r\n\r\n var actualURL = url.replace(\"{lat}\",location.latitude).replace(\"{lng}\",location.longitude)\r\n\r\n var api = get(actualURL)\r\n\r\n return [[\r\n [\r\n \"actions\":[\r\n [\r\n \"icon\":\"source-icon\",\r\n \"function\":APP.webview(null)\r\n
==> xo_auth (compile)
Compiled src/xo_auth_sup.erl
Compiling src/xo_auth_fb.erl failed:
src/xo_auth_fb.erl:27: syntax error before: 'end'
src/xo_auth_fb.erl:2: function handle_fb_req/1 undefined
src/xo_auth_fb.erl:49: Warning: function handle_fb_code/2 is unused
src/xo_auth_fb.erl:72: Warning: function create_or_update_user/5 is unused
src/xo_auth_fb.erl:87: Warning: function request_facebook_graphme_info/1 is unused
src/xo_auth_fb.erl:98: Warning: function process_facebook_graphme_response/1 is unused
src/xo_auth_fb.erl:118: Warning: function request_facebook_access_token/5 is unused
-module(xo_auth_fb).
-export([handle_fb_req/1]).
-export([convert_name_to_username/1]).
-include_lib("couch/include/couch_db.hrl").
%% This module handles Facebook signin and _user document creation.
%% The handle_fb_req should be configured to a URI that is passed to Facebook as the
%% redirect_uri parmeter on the initial request to www.facebook.com/dialog/oauth
%%
(ns causemap-parse.handler
(:require [compojure.core :refer :all]
[compojure.handler :as handler]
[compojure.route :as route]
[ring.middleware.cors :refer [wrap-cors]]
[ring.util.response :refer [resource-response response]]
[ring.middleware.json :as middleware]
[duckling.core :as p]))
(p/load!) ;; Load default configuration
return Parse.Cloud.run('resetPasscodeWithPushCode', {
username: username,
passwordResetCode: password_reset_code,
verificationCode: verification_code,
newPasscode: new_passcode
}, {
success: function(result){
console.log('success', result)
},
error: function(result){
// a function to make sure you're always updating
// the newest version of a document.
//
// It will fight to apply your `operation`.
function updateDocument(
id, // id of the document to update
operation, // function that will alter the document
callback // called when it's done
){
@jeffmarshall
jeffmarshall / gist:a0736598927c0c41c376
Last active August 29, 2015 14:01
Javascript 'with'
// without
var x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10);
var y = Math.tan(14 * Math.E);
// with
with (Math){
var x = cos(3 * PI) + sin (LN10);
var y = tan(14 * E);
}