Skip to content

Instantly share code, notes, and snippets.

View tgallant's full-sized avatar
🌁
☕️☕️☕️

Tim Gallant tgallant

🌁
☕️☕️☕️
  • San Francisco, CA
View GitHub Profile
// 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`
{
"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"
(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"]]
(ns example.core)
(enable-console-print!)
(.log js/console "Hello!")
<!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>
[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
@tgallant
tgallant / e1.scm
Last active August 29, 2015 14:08
euler1
;; e1
(define (mod-three-or-five? x)
(if (or
(= (modulo x 3) 0)
(= (modulo x 5) 0)) #t #f))
(define (e1 x)
(sum
(filter
@tgallant
tgallant / e2.scm
Created November 4, 2014 05:14
euler2
;; helpers
(define (sum l)
(if (null? l)
0
(+ (car l) (sum (cdr l)))))
;; e2
(define (fib x)
@tgallant
tgallant / e3.scm
Created November 4, 2014 05:18
euler3
;; 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))
@tgallant
tgallant / e4.scm
Created November 4, 2014 05:23
euler4
;; 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)))