This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Formatting constants | |
| export BOLD=`tput bold` | |
| export UNDERLINE_ON=`tput smul` | |
| export UNDERLINE_OFF=`tput rmul` | |
| export TEXT_BLACK=`tput setaf 0` | |
| export TEXT_RED=`tput setaf 1` | |
| export TEXT_GREEN=`tput setaf 2` | |
| export TEXT_YELLOW=`tput setaf 3` |
This file contains hidden or 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
| ;;; pbcopy.el --- Emacs Interface to pbcopy | |
| ;; Copyright (C) 2011 Daniel Nelson, based on xclip.el, by Leo Shidai Liu | |
| ;; This file is free software; you can redistribute it and/or modify | |
| ;; it under the terms of the GNU General Public License as published by | |
| ;; the Free Software Foundation; either version 3, or (at your option) | |
| ;; any later version. | |
| ;; This file is distributed in the hope that it will be useful, |
This file contains hidden or 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
| ;; syuta's solution to A Half-Truth | |
| ;; https://4clojure.com/problem/83 | |
| (fn[& arg] | |
| (loop[cur (first arg) cdr(rest arg)] | |
| (if(empty? cdr) | |
| false | |
| (if(= cur (first cdr)) | |
| (recur (first cdr) (rest cdr)) | |
| true)))) |
This file contains hidden or 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
| gem 'pg' | |
| group :development do | |
| gem 'ruby-debug' | |
| end | |
| gem 'rake', '~> 0.8.7' | |
| gem 'devise' | |
| gem 'oa-oauth', :require => 'omniauth/oauth' | |
| gem 'omniauth' | |
| gem 'haml' | |
| gem 'dynamic_form' |
This file contains hidden or 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
| -module(basic). | |
| -export([say_hello/0, | |
| make_hello/0, | |
| match_me/1 | |
| ]). | |
| say_hello() -> | |
| io:fwrite("Ohai!\n"). | |
| make_hello() -> |
This file contains hidden or 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
| /** Command-line options parser (http://valeriu.palos.ro/1026/). | |
| Copyright 2011 Valeriu Paloş (valeriu@palos.ro). All rights reserved. | |
| Released as Public Domain. | |
| Expects the "schema" array with options definitions and produces the | |
| "options" object and the "arguments" array, which will contain all | |
| non-option arguments encountered (including the script name and such). | |
| Syntax: | |
| [«short», «long», «attributes», «brief», «callback»] |
This file contains hidden or 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 sys = require('sys'), | |
| spawn = require('child_process').spawn, | |
| // args from command line | |
| filename, servers; | |
| if (process.ARGV.length < 4) { | |
| return sys.puts("Usage: node remote-tail.js filename server1 [serverN]"); | |
| } |
This file contains hidden or 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
| (ns aws.s3 | |
| (:refer-clojure :exclude [get]) | |
| (:use [clojure.walk :only (keywordize-keys stringify-keys)] | |
| [clojure.contrib.def :only (defonce-)] | |
| [clojure.contrib.json :only (read-json write-json)]) | |
| (:import [java.io PrintWriter InputStreamReader ByteArrayInputStream ByteArrayOutputStream] | |
| [java.util.zip GZIPInputStream GZIPOutputStream] | |
| [com.google.common.base Charsets] | |
| [com.amazonaws.services.s3 AmazonS3Client] | |
| [com.amazonaws.services.s3.model Region CreateBucketRequest ObjectMetadata |
This file contains hidden or 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
| (defn neighbors-of [cell] | |
| (set (for [dx [-1 0 1] dy [-1 0 1] :when (not (= [dx dy] [0 0]))] | |
| [(+ dx (first cell)) (+ dy (second cell))]))) | |
| (defn alive? [[cell freqs] world] | |
| (or (and (= 2 freqs) (contains? world cell)) (= 3 freqs))) | |
| (defn tick [world] | |
| (let [frequencies (frequencies (reduce #(concat %1 (neighbors-of %2)) [] world))] | |
| (set (keys (filter #(alive? % world) frequencies))))) |
This file contains hidden or 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
| (defproject seqex "1.0.0-SNAPSHOT" | |
| :description "a tiny pattern matcher" | |
| :dependencies [[org.clojure/clojure "1.2.1"]] | |
| :source-path "" | |
| :aot [seqex] | |
| :omit-source true) |