Skip to content

Instantly share code, notes, and snippets.

Fogus fogus

Block or report user

Report or block fogus

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

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

View scratch.clj
(defn double-map [f]
(let [^clojure.lang.IFn$DD f f]
(fn [f1]
(if (instance? clojure.lang.IFn$DDD f1)
(let [^clojure.lang.IFn$DDD f1 f1]
([] (f1))
(^double [^double result] (.invokePrim ^clojure.lang.IFn$DD f1 result))
(^double [^double result ^double input]
(.invokePrim f1 result (.invokePrim f input)))
samaaron / gist:6509442
Last active Dec 22, 2015
Simple Promise implementation in Ruby
View gist:6509442
require 'thread'
module SonicPi
class Promise
def initialize
@val_sem =
@push_sem =
@box =
@value = nil
timperrett / gist:6224373
Created Aug 13, 2013
Shapeless typed element selection
View gist:6224373
Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless._, HList._
import shapeless._
import HList._
scala> "foo" :: 124 :: HNil
res0: shapeless.::[java.lang.String,shapeless.::[Int,shapeless.HNil]] = foo :: 124 :: HNil
danneu /
Last active Sep 28, 2017
Google I/O 2012 - Go Concurrency Patterns ported to Clojure Video:
Chouser / externs_for_cljs.clj
Created Jun 17, 2013
Generate an externs.js file for arbitrary JS libraries for use in advanced Google Closure compilation, based on the ClojureScript code that uses the libraries.
View externs_for_cljs.clj
(ns n01se.externs-for-cljs
(:require [ :as io]
[cljs.compiler :as comp]
[cljs.analyzer :as ana]))
(defn read-file [file]
(let [eof (Object.)]
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))]
(vec (take-while #(not= % eof)
(repeatedly #(read stream false eof)))))))
cgrand / comprehensions.clj
Created May 24, 2013
Comprehension framework, upon which are (re)implemented, for, doseq, reducible/foldable for and reduce-based doseq
View comprehensions.clj
;; I wrote this in the Eurostar on my way back from the last clojure course.
(ns comprehensions
(:refer-clojure :exclude [for doseq])
(:require [clojure.core.reducers :as r]))
;; borrowed from clojure.core
(defmacro ^{:private true} assert-args
[& pairs]
`(do (when-not ~(first pairs)
View clips-mode.el
;;; clips-mode.el --- Clips editing mode.
;;; Basado en jess-mode.el de:
;; Copyright (C) 1999 by David E. Young.
;; Modified 2012 by Fogus (
;; Author: David E. Young <>
;; Keywords: languages, clips
View gist:5122217
data StartsWithA a b = StartsWithA a (StartsWithB a b)
| EmptyA
deriving Show
data StartsWithB a b = StartsWithB b (StartsWithA a b)
| EmptyB
deriving Show
infixr 7 <<<
infixr 7 >>>
View gist:5018273
You can’t perform that action at this time.