Skip to content

Instantly share code, notes, and snippets.

Alan Dipert alandipert

Block or report user

Report or block alandipert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alandipert
alandipert / README.md
Last active Aug 7, 2019 — forked from jcheng5/README.md
Installing R-devel on Solaris 10 VM
View README.md

As far as CRAN is concerned, there are two flavors of R on Solaris: one that is built using the Solaris Studio compiler, and one that is built using the GNU/gcc toolchain. The latter is far more up-to-date, but if your package requires it, then your DESCRIPTION file must declare that with the line SystemRequirements: GNU make.

These instructions are for configuring, building, and installing R-devel using the GNU/gcc toolchain (only).

You'll need VMWare Fusion on Mac, or VMWare Workstation (?) on Windows/Linux.

Get Solaris VM

Download the Solaris VM provided by Jeroen Ooms: https://github.com/jeroen/solarisvm

View Vagrantfile
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
apt-get update
apt-get install -y git maven openjdk-7-jdk
(
cd /usr/local/bin
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O lein
chmod +x lein
View inkystarter.cljs
(ns inkystarter
"Intro sketch for inky.cc, fork away."
(:require [inky.sketch :as sketch]))
(sketch/page-style!
(concat
sketch/default-styles
[:body {:font-family "'Helvetica Neue', Arial, sans-serif"}
:.sketch {:padding "30px"}]))
@alandipert
alandipert / lis.pl
Created Dec 1, 2012 — forked from syohex/lis.pl
Simple Scheme interpreter in Perl(inspired by lis.py http://norvig.com/lispy.html)
View lis.pl
#!perl
use strict;
use warnings;
package Lispl;
use Scalar::Util qw(blessed looks_like_number);
use List::Util qw(reduce);
my $global_env;
View units.clj
;;; Author: Scott Jaderholm
;;; Created: 2009-12-18
;;;
;;; Short Description: Automates the creation of unit conversion
;;; functions and includes several common ones.
;;;
;;; Detailed Description: So for inches, feet, and meters, if you
;;; provide equations for inches-to-feet and feet-to-meters, then this
;;; package will automatically create feet-to-inches, meters-to-feet,
;;; inches-to-meters, meters-to-inches, and all the corresponding
View plet.clj
(defmacro letp
[bindings & exprs]
(let [bindings (partition 2 bindings)
vars (->> bindings (map first) vec)
values (->> bindings (map second))]
`((fn ~vars ~@exprs)
~@values)))
(def a 7)
(def y 2)
View plet.clj
(defn deconstruct
([l]
(thisfn l [] []))
([l vars values]
(if (seq l)
(recur (rest (rest l))
(conj vars (first l))
(conj values (first (rest l))))
[vars values])))
View gist:2719629
Def fizzbuzz ≡ (eq0 ∘ strlen ∘ 2 → 1; 2) ∘
[1, strcat ∘ tl] ∘
[1, (eq0 ∘ 2 → ~'Fizz'; ~''), (eq0 ∘ 3 → ~'Buzz'; ~'')] ∘
[id, mod ∘ [id, ~3], mod ∘ [id, ~5]]
(αfizzbuzz ∘ iota):100
View lithp.rb
class Lisp
def initialize
@env = {
:label => lambda { |(name,val), _| @env[name] = val },
:quote => lambda { |sexpr, _| sexpr[0] },
:car => lambda { |(list), _| list[0] },
:cdr => lambda { |(list), _| list.drop 1 },
:cons => lambda { |(e,cell), _| [e] + cell },
:eq => lambda { |(l,r), _| l == r },
:if => lambda { |(cond, thn, els), ctx| eval(cond, ctx) ? eval(thn, ctx) : eval(els, ctx) },
@alandipert
alandipert / config.ru
Created Jan 5, 2012
Deploy static sites to heroku and use heroku caching
View config.ru
use Rack::Static,
:urls => ['/css', '/images'], # put directories here, files will get served for free
:root => "public"
run lambda { |env|
[
200,
{ 'Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=86400' },
File.open('public/index.html', File::RDONLY) # Point this at the starting file
]
You can’t perform that action at this time.