Skip to content

Commit ee77f77

Browse files
Big horrible commit that I am really ashamed of...
Create a gitbook project Added Klipse as a plugin Added the existing clojurebridge content
0 parents  commit ee77f77

File tree

823 files changed

+58491
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

823 files changed

+58491
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ClojureBridge London
2+
3+
Testing an alternative content style for the ClojureBridge curriculum.
4+
5+
This uses 99% of the existing ClojureBridge curriculum content, however instead of slides we are using Gitbook to provide structure and format of the content.
6+
7+
## Navigation with arrow keys
8+
9+
The pages in the workshop can be navigated using the right and left arrow keys, or by pressing the arrows as the side of each page.
10+
11+
## Using Klipse for live evaluation
12+
13+
The Klipse live repl is also included in this website to make the code snippets interactive. All code examples and exercises are placed in Klipse code snippets.
14+
15+
```eval-clojure
16+
(defn live-evaluation? [opinion]
17+
(str "Klipse live evaluation is... " opinion))
18+
19+
(live-evaluation? "awesomenessness")
20+
```
21+
22+
> #### Hint::Klipse can use Github Gists
23+
> You can include code in Klipse evaluation that has been added to public [Github Gists](https://gist/github.com)
24+
25+
## Exercises
26+
27+
Exercises are denoted by using the Note callout plugin for github. Excercises look like:
28+
29+
> #### Note::Create a Clojure project
30+
> Use the Leiningen tool to create a project called **clojure-is-awesomenessness**
31+
32+
## Answers
33+
34+
Answers to questions can be either put into github gists or included directly in the workshop and placed in hidden sections. An example of an answer in a hidden section is as follows:
35+
36+
<!--sec data-title="Reveal answer..." data-id="answer00" data-collapse=true ces-->
37+
38+
```clj
39+
(defn who-has-the-answer [name])
40+
(str "Only " name " have the answer"))
41+
42+
(who-has-the-answer "Smarties")
43+
```
44+
45+
> #### Hint::
46+
> Answers are added as fixed code blocks so the students dont accidentally change them and then get confused when the answer doesnt work.
47+
48+
<!--endsec-->

SUMMARY.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Summary
2+
3+
* [Introduction](README.md)
4+
* [Preparing for the Workshop](prepare-for-the-workshop.md)
5+
* [Introducing Clojure](introducing-clojure/index.md)
6+
* [Why Clojure?](introducing-clojure/why-clojure.md)
7+
* [What is Clojure good at?](introducing-clojure/what-is-clojure-good-at.md)
8+
* [Creative Arts](introducing-clojure/clojure-creative-arts.md)
9+
* [SVG Graphics](introducing-clojure/clojure-svg-graphics.md)
10+
* [2D Games](introducing-clojure/clojure-games.md)
11+
* [What does Clojure look like?](introducing-clojure/what-does-clojure-look-like.md)
12+
* [Comments](introducing-clojure/comments.md)
13+
* [What is a REPL](introducing-clojure/what-is-a-repl.md)
14+
* [Klipse web-based REPL](introducing-clojure/klipse-web-based-repl.md)
15+
* [LightTable InstaREPL](introducing-clojure/lighttable-instarepl.md)
16+
* [Using LightTable Instarepl](introducing-clojure/trying-the-instarepl.md)
17+
* [Evaluating Turtle Project](introducing-clojure/evaluate-turtle-project.md)
18+
* [Clojure Docs](introducing-clojure/clojure-docs.md)
19+
* [Simple Values](simple-values/index.md)
20+
* [Numbers](simple-values/numbers.md)
21+
* [Integers](simple-values/integers.md)
22+
* [Decimals](simple-values/decimals.md)
23+
* [Ratios](simple-values/ratios.md)
24+
* [Arithmetic](simple-values/arithmetic.md)
25+
* [Prefix Notation](simple-values/prefix-notation.md)
26+
* [Strings](simple-values/strings.md)
27+
* [Boolean values](simple-values/boolean.md)
28+
* [Testing Truthiness](simple-values/testing-truthiness.md)
29+
* [Keywords](simple-values/keywords.md)
30+
* [Assignment](simple-values/assignment.md)
31+
* [Assigning Results](simple-values/assigning-results.md)
32+
* [Exercise: Basic Arithmetic](simple-values/exercise-1-basic-arithmetic.md)
33+
* [Data Structures](data-structures/index.md)
34+
* [Vectors](data-structures/vectors.md)
35+
* [Vector Syntax](data-structures/vector-syntax.md)
36+
* [Vector Creation](data-structures/vector-creation.md)
37+
* [Vector Extraction](data-structures/vector-extraction.md)
38+
* [Vector Update](data-structures/vector-update.md)
39+
* [Exercise: Weather Forcast](data-structures/vector-excercise-weather-forcast.md)
40+
* [Maps](data-structures/maps.md)
41+
* [Map Syntax](data-structures/map-syntax.md)
42+
* [Map Creation](data-structures/map-creation.md)
43+
* [Map Update](data-structures/map-update.md)
44+
* [Map Extraction with get](data-structures/map-extraction-with-get.md)
45+
* [Map Extraction with keys & vals](data-structures/map-extraction-keys-vals.md)
46+
* [Collection of Collections](data-structures/collection-of-collections.md)
47+
* [Exercise: Model People](data-structures/exercise-model-people.md)
48+
* [Functions](functions/index.md)
49+
* [What are functions](functions/what-are-functions.md)
50+
* [Defining Functions](functions/defining-functions.md)
51+
* [Higher Order Functions](functions/functions-as-arguments.md)
52+
* [map function](functions/map-function.md)
53+
* [reduce function](functions/reduce-function.md)
54+
* [Map Reduce Sandwich](functions/map-reduce-sandwich.md)
55+
* [Exercise: Find the average](functions/exercise-find-the-average.md)
56+
* [Local Assignment with let](functions/local-assignment-with-let.md)
57+
* [Predicate Functions](functions/predicate-functions.md)
58+
* [Anonymous Functions](functions/anonymous-functions.md)
59+
* [Named or anonymous functions](functions/named-or-anonymous-functions.md)
60+
* [Calling anonymous functions](functions/calling-anonymous-functions.md)
61+
* [Arguments to functions](functions/arguments-to-functions.md)
62+
* [Simplicity with Pure Functions](functions/pure-functions.md)
63+
* [Pure function examples](functions/pure-function-examples.md)
64+
* [Impure function examples](functions/impure-function-examples.md)
65+
* [First Project](first-project/index.md)
66+
* [Drawing Lines (Nightcode)](https://github.com/clojurebridge-berlin/drawing/blob/master/curriculum/first-program.md)
67+
* [Celebrity Name Smash](first-project/celebrity-name-smash.md)
68+
* [Flow Control & Logic](flow-control-logic/index.md)
69+
* [if](flow-control-logic/if.md)
70+
* [truthiness](flow-control-logic/truthiness.md)
71+
* [Exercise: positions](flow-control-logic/exercise-positions.md)
72+
* [Excercise: positions continued](flow-control-logic/exercise-positions-continued.md)
73+
* [cond](flow-control-logic/cond.md)
74+
* [Exercise: Temperature conversion](flow-control-logic/exercise-temperature-conversion.md)
75+
* [Boolean Logic](flow-control-logic/boolean-logic.md)
76+
* [Sequences](sequences/index.md)
77+
* [Additional Projects](additional-projects/index.md)
78+
* [Snowflakes Animation (Quil)](https://github.com/ClojureBridge/drawing/blob/master/curriculum/create-something.md)
79+
* [Land of Quil](http://landofquil.we-do-fp.berlin/)
80+
* [Twinkle Twinkle Little Star](https://github.com/ClojureBridge/tones/blob/master/curriculum/01-piano-chords.md)
81+
* [Global Growth](https://github.com/ClojureBridge/global-growth)
82+
* [Caesar Cipher](http://clojurebridge.github.io/community-docs/docs/exercises/caesar-cipher/)
83+
* [Turtles Walk](https://github.com/ClojureBridge/welcometoclojurebridge/blob/master/outline/TURTLE-SAMPLES.md)
84+
* [Klipse](klipse/index.md)
85+
* [Klipse Scope](klipse/scope.md)
86+
* [Klipse issues](klipse/issues.md)
87+
* [Fancy Keyboard Keys](fancy-keyboard-keys.md)
88+
* [Alternative course](new/index.md)
89+
* [Strings](new/strings/index.md)
90+
* [Define yourself](new/strings/define-your-name.md)
91+
* [Calling functions](calling-functions/index.md)
92+
* [Counting](new/strings/counting.md)
93+
* [Join & Split](new/strings/join-split.md)
94+
* [Numbers](new/numbers/index.md)
95+
* [Interest in coding](new/numbers/time-spent-coding.md)
96+
* [Arithmetic](new/arithmetic/index.md)
97+
* [Addition](new/arithmetic/addition.md)
98+
* [Subtraction](new/arithmetic/subtraction.md)
99+
* [Multiplication](new/arithmetic/multiplication.md)
100+
* [Division](new/arithmetic/division.md)
101+
* [Ratio](new/arithmetic/ratio.md)
102+
* [Prefix notation](new/arithmetic/prefix-notation.md)
103+
104+
105+
* [Basics]()
106+
* [Strings]()
107+
* [Numbers]()
108+
* [Calling functions]()
109+
* [Arithmetic]()
110+
* [Collections]()

additional-projects/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Additional Projects
2+
3+
Try out the basics of Clojure you have learnt so far by trying one of the following projects
4+
5+
#### Graphics with Quil
6+
* [Snowflakes](https://github.com/ClojureBridge/drawing/blob/master/curriculum/create-something.md) Animation
7+
* [Land of Quil](http://landofquil.we-do-fp.berlin/) Several Quil examples you can try out
8+
9+
10+
#### Other applications
11+
* [Twinkle Twinkle Little Star](https://github.com/ClojureBridge/tones/blob/master/curriculum/01-piano-chords.md) Making sounds with Overtone
12+
* [Global Growth](https://github.com/ClojureBridge/global-growth) Web app with REST api
13+
* [Caesar Cipher](http://clojurebridge.github.io/community-docs/docs/exercises/caesar-cipher/) Mini exercise of Strings and Characters
14+
* [Turtles Walk](https://github.com/ClojureBridge/welcometoclojurebridge/blob/master/outline/TURTLE-SAMPLES.md) More function study

book.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"gitbook": ">=3.0.0",
3+
"title": "Clojurescript Practicalli",
4+
"styles": {
5+
"ebook": "styles/ebook.css",
6+
"pdf": "styles/pdf.css",
7+
"mobi": "styles/mobi.css",
8+
"epub": "styles/epub.css"
9+
},
10+
"plugins": [
11+
"toggle-chapters",
12+
"codeblock-disable-glossary",
13+
"disqus",
14+
"ga",
15+
"toolbar",
16+
"callouts",
17+
"sectionx",
18+
"klipse"
19+
],
20+
"pluginsConfig": {
21+
"callouts": {
22+
"showTypeInHeader": false,
23+
"star": {
24+
"alert": "warning",
25+
"picto": "fa-star"
26+
}
27+
},
28+
"sectionx": {
29+
"tag": "b"
30+
},
31+
"disqus": {
32+
"shortName": "clojurebridgelondon-workshop"
33+
},
34+
"ga": {
35+
"token": "UA-28030709-10"
36+
},
37+
"toolbar": {
38+
"buttons":
39+
[
40+
{
41+
"label": "Gitter Chat",
42+
"icon": "fa fa-comments-o",
43+
"url": "https://gitter.im/practicalli/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"
44+
},
45+
{
46+
"label": "GitHub",
47+
"icon": "fa fa-github",
48+
"url": "https://github.com/practicalli"
49+
},
50+
{
51+
"label": "Search page title on StackOverflow",
52+
"icon": "fa fa-stack-overflow",
53+
"url": "http://stackoverflow.com/search?q={{title}}"
54+
}
55+
]
56+
}
57+
}
58+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Collections of Collections
2+
3+
Simple values such as numbers, keywords, and strings are not the
4+
only types of things you can put into collections. You can also put
5+
other collections into collections, so you can have a vector of
6+
maps, or a list of vectors, or whatever combination fits your data.
7+
8+
## Vector of Maps
9+
10+
```eval-clojure
11+
(def characters
12+
[{:name "Snoopy"
13+
:species "dog"}
14+
{:name "Woodstock"
15+
:species "bird"}
16+
{:name "Charlie Brown"
17+
:species "human"}])
18+
19+
;;(:name (first characters))
20+
;;=> "Snoopy"
21+
22+
(map :name characters)
23+
```
24+
25+
## Maps of Maps & Vectors
26+
27+
A simple model of the Starwars characters and vehicles
28+
29+
```eval-clojure
30+
{:starwars {
31+
:characters {
32+
:jedi ["Luke Skywalker"
33+
"Obiwan Kenobi"]
34+
:sith ["Darth Vader"
35+
"Darth Sideous"]
36+
:droids ["C3P0"
37+
"R2D2"
38+
"BB-8"]}
39+
:ships {
40+
:rebel-alliance ["Millenium Falcon"
41+
"X-wing figher"]
42+
:imperial-empire ["Intergalactic Cruser"
43+
"Destroyer"]}}}
44+
```
45+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## EXERCISE: Modelling People
2+
3+
4+
> #### Note::Model Yourself
5+
Make a map representing yourself, using only the information about yourself you want to share.
6+
>
7+
> Example information could include: your first name and last names, where you grew up, favourite food.
8+
>
9+
> Add some information directly to the map, then use [assoc](http://grimoire.arrdem.com/1.6.0/clojure.core/assoc/) or [merge](http://grimoire.arrdem.com/1.6.0/clojure.core/merge/) to add more.
10+
```eval-clojure
11+
()
12+
```
13+
14+
<hr />
15+
16+
> #### Note::[BONUS]: Model your classmates
17+
> Use the map you made about yourself in previous exercise.
18+
>
19+
> Create a vector of maps containing the first name, last name and hometown of two or three other classmates around you.
20+
>
21+
> Add your map to their information using [conj](http://clojuredocs.org/clojure.core/conj).
22+
```eval-clojure
23+
()
24+
```
25+
26+
27+
<!--sec data-title="Reveal answer..." data-id="answer001" data-collapse=true ces-->
28+
29+
> #### Todo::Add example answer
30+
31+
<!--endsec-->
32+
33+
34+

data-structures/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Data Structures
2+
3+
So far, we've dealt with discrete pieces of data: one number, one
4+
string, one value. When programming, it is more often the case that
5+
you want to work with groups of data.
6+
7+
Clojure has great facilities for working with these groups, or
8+
*collections*, of data. Not only does it provide four different types
9+
of collections, but it also provides a uniform way to use all of these
10+
collections together.
11+
12+
* [Vectors](vectors.html)
13+
* [Maps](maps.html)
14+
* Lists
15+
* Sets
16+
17+
> #### Hint::
18+
> Vectors and Maps are the most common data structures used in Clojure for defining and working with data, so we will just focus on those.
19+
20+
21+
22+

data-structures/map-creation.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Map Creation
2+
3+
`assoc` and `dissoc` are paired functions: they associate and disassociate items from a map.
4+
5+
See how we add the last name "Brown" to the map with `assoc`, and then we remove it with `dissoc`.
6+
7+
`merge` merges two maps together to make a new map.
8+
9+
```clojure
10+
(assoc {:first "Sally"} :last "Brown")
11+
;=> {:first "Sally", :last "Brown"}
12+
13+
(dissoc {:first "Sally" :last "Brown"} :last)
14+
;=> {:first "Sally"}
15+
16+
(merge {:first "Sally"} {:last "Brown"})
17+
;=> {:first "Sally", :last "Brown"}
18+
```
19+
20+
> #### Note::
21+
```eval-clojure
22+
()
23+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#### Map Extraction with Keys and Vals
2+
3+
`keys` and `vals` are functions that return all the keys and all the values in the map respectively.
4+
5+
The order of the keys or values returned is not guaranteed, so we could have gotten `(:firstname :lastname)` or `(:lastname :firstname)`.
6+
7+
Lets get the keys:
8+
9+
```eval-clojure
10+
(keys {:firstname "Sally" :lastname "Brown"})
11+
```
12+
13+
Now lets get the values:
14+
15+
```eval-clojure
16+
(vals {:firstname "Sally" :lastname "Brown"})
17+
```
18+
19+
> #### Note::Get the Keys & Values from the map of yourself
20+
> Use the map you made about yourself in previous exercise and extract the keys & values from that.
21+
>
22+
> Create a vector of maps containing the first name, last name and hometown of two or three other classmates around you.
23+
>
24+
> Add your map to their information using [conj](http://clojuredocs.org/clojure.core/conj).
25+
```eval-clojure
26+
()
27+
```
28+
29+
<!--sec data-title="Example answer..." data-id="answer001" data-collapse=true ces-->
30+
31+
> #### Todo::Provide example answer
32+
33+
34+
<!--endsec-->

0 commit comments

Comments
 (0)