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
// Gruntfile | |
module.exports = function(grunt) { | |
require('matchdep').filter('grunt-*').forEach(grunt.loadNpmTasks); | |
// Configure Grunt | |
grunt.initConfig({ | |
// grunt-express will serve the files from the folders listed in `bases` | |
// on specified `port` and `hostname` |
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
{ | |
"name": "example", | |
"version": "0.0.1", | |
"devDependencies": {}, | |
"dependencies": { | |
"grunt": "~0.4.5", | |
"grunt-contrib-watch": "~0.6.1", | |
"grunt-express": "~1.4.1", | |
"grunt-open": "~0.2.3", | |
"matchdep": "~0.3.0" |
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 example "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:jvm-opts ^:replace ["-Xmx1g" "-server"] | |
:dependencies [[org.clojure/clojure "1.6.0"] | |
[org.clojure/clojurescript "0.0-2371"]] |
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 example.core) | |
(enable-console-print!) | |
(.log js/console "Hello!") |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="scripts/out/goog/base.js" type="text/javascript"></script> | |
<script src="scripts/main.js" type="text/javascript"></script> | |
<script type="text/javascript">goog.require("example.core");</script> | |
</body> | |
</html> |
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
[program:blog-checker] | |
command= /usr/local/bin/java -jar target/blog-checker-0.1.0-SNAPSHOT-standalone.jar | |
directory=/usr/local/www/blog-checker | |
autostart=true | |
autorestart=true | |
startretries=3 | |
user=www |
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
;; e1 | |
(define (mod-three-or-five? x) | |
(if (or | |
(= (modulo x 3) 0) | |
(= (modulo x 5) 0)) #t #f)) | |
(define (e1 x) | |
(sum | |
(filter |
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
;; helpers | |
(define (sum l) | |
(if (null? l) | |
0 | |
(+ (car l) (sum (cdr l))))) | |
;; e2 | |
(define (fib x) |
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
;; e3 | |
(define (e3 n) | |
(define (e3-inner num div) | |
(if (> num 1) | |
(if (= (modulo num div) 0) | |
(e3-inner (/ num div) (- div 1)) | |
(e3-inner num (+ div 1))) | |
(+ div 1))) | |
(e3-inner n 2)) |
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
;; e4 | |
(define (e4) | |
(define (e4-inner x y) | |
(let ((i (* x y))) | |
(if (> x 999) | |
'() | |
(if (< y 999) | |
(if (= i (rev i)) | |
(cons i (e4-inner x (+ y 1))) |
OlderNewer