Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

View GitHub Profile
@selfsame
selfsame / gist:8b88db25f1abd433bfe0
Created September 25, 2014 23:00
hard.input WIP
(ns hard.input
(:import
[UnityEngine Input KeyCode Camera Physics]))
(declare mouse?)
(defn get-keycode [s]
(try (or (eval (symbol (str "KeyCode/" s))) false) (catch Exception e nil)))
(defn ^:private kcode* [k]
@selfsame
selfsame / gist:6eb5c9c9f3c4d7aa5572
Last active August 29, 2015 14:06
hard.core unity interop
(ns hard.core
(:import
[UnityEngine Physics Debug Resources PrimitiveType Application Color Input]))
(defn log [x]
(UnityEngine.Debug/Log x))
(defn resource [s] (UnityEngine.Resources/Load s))
;is a no arg qmark fn bad style?
(ns ships.core
(:use [unity.core])
(:import
[UnityEngine Debug Resources PrimitiveType Application]))
(defprotocol IAwake
(Awake [this]))
(defprotocol IStart
(Start [this]))
(ns hard.core
(:import
[UnityEngine Debug Resources PrimitiveType Application]))
(defn log [x]
(UnityEngine.Debug/Log x))
;(defn math [f & more]
; (. UnityEngine.Mathf (f more)))
;saved documents have data for :filesystem, :filepath, :unsaved-changes, :file-uid
(defn get-iframe [data]
"Returns the iframe element for the given
Workspace cursor"
(let [id (:iframe-id data)]
(.getElementById js/document id)))
(defn to-html [element]
"Returns the HTML string of the element and it's contents, when given an iframe returns only content HTML.")
@selfsame
selfsame / gist:f39f7e6d066ccdb64d5a
Created July 15, 2014 05:45
filtering om cursors test
(def app-state (atom {:vect
[{:uid 0 :i 0}
{:uid 1 :i 0}
{:uid 2 :i 0}
{:uid 3 :i 0}
{:uid 4 :i 0}
{:uid 5 :i 0}
{:uid 3 :i 0}]}))
(plomb/defcomp item [data owner]
(sug/defcomp t-c-2
[data owner opts]
{:render-state
(fn [_ state]
(let []
(.log js/console (.-_rootNodeID owner))
(dom/div nil
(dom/p nil (prn-str (.-__om_cursor (.-props owner))))
(dom/button #js {:onClick #(sug/up! :c owner {:thing true})} "eventer")
)))})
"The space captain" by Joseph Parker
Chapter 1 - Declarations
A zone is a kind of container. Zones are usually enterable. Zones are usually transparent.
A galaxy is a kind of room.
A cluster is a kind of zone.
A system is a kind of zone.
<?php
$con = new Connection();
$res = $con->query('SELECT word, hash FROM `keywords` LIMIT 0, 30 ');
$rows = array();
while($r = $res->fetch_assoc()) {
echo $r["word"]." ".$r["hash"]."<br>";
}