Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Connection | |
(defprotocol DatomicConnection | |
(as-conn [_])) | |
(extend-protocol DatomicConnection | |
datomic.Connection | |
(as-conn [c] c) | |
datomic.db.Db |
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
(ns creator.core | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [om.core :as om :include-macros true] | |
[cljs.core.async :as async :refer [chan <! >! put!]] | |
[om-tools.core :refer-macros [defcomponent]] | |
[cljs.reader :as reader] | |
[goog.dom :as gdom] | |
[om-tools.dom :as dom :include-macros true]) | |
(:import [goog.net XhrIo])) |
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
(ns inputstream.core | |
(:require [clojure.java.io :as io])) | |
(defn read-is [^java.io.InputStream is] | |
(let [bufsize 8192 | |
buf (byte-array bufsize)] | |
(loop [total-len 0] | |
(let [n (.read is buf)] | |
(cond |
Kudos to @paulscott56 for the cool name. It all started on twitter.
School websites suck, actually, schools suck at being online. But in reality, schools don't need much to be online. 99/100 times the minimum viable school site might just be single static page with contact information, links to FB and/or Twitter. Oh, and a "add my to the mailing list" feature, cause that would be better...
The sad thing is that currently we have three camps, maybe more:
- Schools getting exploited by unsavoury IT companies and paying big bucks for mediocre FOSS deployments with Corel Draw graphics.
- Schools teachers acting defensively against anyone who is better than them at operating Dreamweaver
Here are some links that were helpful in me building my presentation.
The article that got me started on this topic.
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
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services | |
Download the following ZIPs: | |
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
Download the correct GApps for your Android version: | |
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) |
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
class FriendlyGuid | |
attr_reader :mask | |
def initialize(mask) | |
@mask = mask | |
end | |
def guid(id) | |
(id.to_i ^ mask).to_s(36) | |
end |
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
;;; I'm not using Om yet because I've got a lot of code using Pump and just haven't made the transition, | |
;;; but the principles are all the same. So you'll see Pump-specific code here. | |
(def code->key | |
"map from a character code (read from events with event.which) | |
to a string representation of it. | |
Only need to add 'special' things here." | |
{13 "enter" | |
37 "left" | |
38 "up" |
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
#app/inputs/collection_check_boxes_input.rb | |
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput | |
def item_wrapper_class | |
"checkbox-inline" | |
end | |
end |