This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
***The 'properties' property is for anything that is game specific*** | |
-IF SCHEMA BELOW- | |
Player | |
- current room | |
- moves | |
- score | |
- items | |
- properties (eg. health, gold, etc...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const moment = require("moment"), | |
_ = require("lodash"); | |
function getWeeksOfYearList(startDate, endDate) { | |
let dates = [], | |
keepGoing = true, | |
start = moment(startDate), | |
end = moment(endDate), | |
rolling = start; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var querystring = require('querystring') | |
var xhr = require('xhr') | |
if (!xhr.open) xhr = require('request') | |
var allowedProperties = [ | |
'fields', | |
'channelId', | |
'channelType', | |
'eventType', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject your-project "0.0.1-SNAPSHOT" | |
:description "Describe your app here" | |
:url "http://somewhere.com" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[org.clojure/clojurescript "0.0-2138"]] | |
:plugins [[lein-cljsbuild "1.0.1"]] | |
:cljsbuild | |
{:builds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def data (atom [])) | |
;(def data1 [{:abc "123"}{:bcd "234"}]) | |
;swap! data conj {:foo "bar"}) | |
;(swap! data into data1) | |
(def more-data ["foo" "bar" "hello" "world"]) | |
(swap! data into (map #(conj {} {:name %}) more-data)) | |
(swap! data conj {:hello "1234"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This does not work, boo! Don't know how to tell Clojure that IsReusable is a property | |
(System.Reflection.Assembly/LoadWithPartialName "System.Web") | |
(defn foo-handler [] | |
(reify System.Web.IHttpHandler | |
(IsReusable [] false) | |
(ProcessRequest [context] ()))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Playing here, trying to figure out how to work with vectors of maps, my brain synapses are connecting but | |
; this code doesn't totally reflect the connections made. This will be rectified within 24 hours! HAHA! | |
;(def buffers (atom [])) | |
;(swap! buffers conj {:file-name "one.txt" :file-text "first file"} | |
; {:file-name "two.txt" :file-text "second file"} | |
; {:file-name "three.txt" :file-text "third file"} | |
; {:file-name "four.txt" :file-text "fourth file"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn actions [array-of-funcs] | |
(doseq [func array-of-funcs] (func))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; Part of some learning exercises I'm doing. This returns a map of filenames for a series of file paths passed in | |
;; | |
(defn get-filenames-from-paths [& paths] | |
(map #(-> % | |
(.getFileName) | |
(.toString)) | |
(map #(java.nio.file.Paths/get (.toURI (java.io.File. %))) paths))) |