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
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
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
ss23@Crisp /etc/init.d $ cat vixie-cron | |
#!/sbin/runscript | |
# Copyright 1999-2011 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/vixie-cron.rc7,v 1.1 2011/12/31 14:58:21 idl0r Exp $ | |
command=/usr/sbin/cron | |
pidfile=/var/run/cron.pid | |
depend() { |
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
# I want a tool that tells me what my modified files are, whether I'm in a Subversion or Git project. | |
# I want to be able to say vim $(dirty) | |
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
my @lines = qx/svn status 2>&1/; | |
exit if @lines == 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
var has = function (obj, property) { | |
var tree = obj, | |
split = property.split('.'), | |
last = split.pop(); | |
while (next = split.shift()) { | |
tree = tree[next]; | |
if (tree === undefined) return false; | |
} |
NewerOlder