Skip to content

Instantly share code, notes, and snippets.

View JonathanSmith's full-sized avatar

Jonathan A Smith JonathanSmith

View GitHub Profile
@JonathanSmith
JonathanSmith / testcase.sh
Last active August 29, 2015 14:04
testcase.sh
#!/bin/bash
PEMFILEPATH=$1
DEV_EMAIL=$2
BUCKET=$3
echo "CREATING 200MB Random File";
dd if=/dev/urandom of=file.in bs=1M count=1
echo "FINISHED CREATING 1MB Random File"
echo "$(ls -ltra file.in)"
cat <<EOF > testcase.js
var gcloud = require("gcloud");
(defun rmap-over-list (function list)
(when list
(cons (funcall function (first list))
(rmap-over-list function (cdr list)))))
(defun imap-over-list (function list)
(loop for value in list collect (funcall function value)))
(defun add7 (number) (+ number 7))
added this:
(ps:chain ($ "div#blog a") (embedly (ps:create "maxWidth" 450)))
and this:
(setf (ps:getprop (ps:chain $ embedly defaults) "key")
,*embedly-key*)
now I will test gist on my site
;;Jonathan Smith 2010
;;inspired by esessoms clj-interface
;;http://github.com/esessoms/clj-interface
(ns libs.erlang (:import
[com.ericsson.otp.erlang
OtpErlangAtom
OtpErlangBinary
OtpErlangBoolean
OtpErlangChar
(defmodule imp (export (bar 0)))
(eval-when-compile
(defun import-function-1 (module function)
;(: io format '"~p~p~n" (list module function))
(let ((mod-fun (list_to_atom
(: lists concat (list module '":" function)))))
; (: io format '"~p~n" (list mod-fun))
(defmethod emit-special 'aget! [type [set! var idx]]
(str (emit var) "[" (emit idx) "]"))
If you look at test_macro.lfe
(defmacro let@
(((vb . vbs) . b) `(let (,vb) (let@ ,vbs . ,b)))
((() . b) `(begin . ,b)))
(defsyntax let&
([(vb . vbs) . b] [let (vb) (let& vbs . b)])
([() . b] [begin . b]))
(defmodule resource4
(author 'jonathansmith415@gmail.com)
(export (out 1)))
(include-file "/home/jon/clyawjure/yaws-1.85/include/yaws_api.lfe")
(defun out (arg)
(let* ((url (: yaws_api request_url arg))
(method (http_request-method (arg-req arg)))
(path (: string tokens (url-path url) '"/")))
(defn mouse-click [[x y] state]
(let [ul (:upper-left state)
lr (:lower-right state)
coord (map / [x y] (:dim state))]
(update-bounds
(assoc state
:offset (map + ul (map * coord (map - lr ul)))))))
(defn key-press [key s]
(if-let [dispatch-fn ({:Z (fn [state]
(defmap rgb-color-fractal
(let [val %
z (.xy val)
n (.z val)
normalized-count (/ (- n (log2 (log2 (sqrt (+ (* (.x z) (.x z)) (* (.y z) (.y z)))))))
(float max-iterations))]
(? (< 4.0 (dot z z))
(color3 normalized-count normalized-count (mix 0.2 1.0 normalized-count))
(color3 0.0 0.0 0.0))))