Skip to content

Instantly share code, notes, and snippets.

@alandipert
alandipert / README.md
Last active August 7, 2019 19:30 — forked from jcheng5/README.md
Installing R-devel on Solaris 10 VM

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

# 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
(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 December 1, 2012 07:04 — forked from syohex/lis.pl
Simple Scheme interpreter in Perl(inspired by lis.py http://norvig.com/lispy.html)
#!perl
use strict;
use warnings;
package Lispl;
use Scalar::Util qw(blessed looks_like_number);
use List::Util qw(reduce);
my $global_env;
;;; 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
(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)
@alandipert
alandipert / plet.clj
Created July 28, 2012 22:39 — forked from fogus/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])))
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
@alandipert
alandipert / lithp.rb
Created January 26, 2012 00:19 — forked from fogus/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 January 5, 2012 18:36
Deploy static sites to heroku and use heroku caching
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
]