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
View apple-langs.md

Apple Languages

Criteria

For inclusion on this list, the language must adhere to at least one of the following:

  1. Developed by Apple and released either free or as product. (e.g. Swift)
  2. Developed by Apple but never formally released during its lifetime. (e.g. SK8)
  3. Licensed by Apple for use in and/or as an official Apple product. (e.g. Applesoft BASIC)
  4. Used by internal teams to develop new or exiting products (e.g. SWEET-16)
View LZ77.java
import java.io.*;
/**
* Class for performing LZ77 compression/decompression using text IO
*
* @author Mark Hall
* @version 1.0
*/
public class LZ77T {
public static final int DEFAULT_BUFF_SIZE = 1024;
@fogus
fogus / 0 - UNIX Fifth Edition
Created Jul 20, 2011
UNIX V5, OpenBSD, Plan 9, FreeBSD, and GNU coreutils implementations of echo.c
View 0 - UNIX Fifth Edition
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
@fogus
fogus / pom2proj.clj
Created Mar 7, 2012 — forked from thickey/pom2proj.clj
Convert Maven pom.xml file to Lein project.clj
View pom2proj.clj
(ns pom2proj
(:require [clojure.xml :as xml]
[clojure.zip :as zip]
[clojure.java.io :as io]
[clojure.data.zip.xml :as zx])
(:use [clojure.pprint :only [pprint]]))
(defn- text-attrs
[loc ks]
(map (fn [k]
View time.txt
"Programs with Common Sense" by JMC
"Situations, Actions, and Causal Laws" by JMC
"A Framework for Representing Knowledge" by Minsky
...
"Why Object-Oriented Languages Need Tail Calls" by GLS
"Worlds: Controlling the Scope of Side-Effects" by Warth, Ohshima, Kaehler, Kay
View pesto5.clj
(defn postfix [& e]
(reduce #(if (fn? %2)
(let [[l r & m] %]
(cons (%2 r l) m))
(cons %2 %)) [] e))
@fogus
fogus / forth.rb
Created Jan 26, 2012 — forked from deadprogram/forth.rb
Forth interpreter in 64 lines of Ruby
View forth.rb
#!/usr/bin/env ruby
def pop; $stack.pop || raise(StackUnderflow); end
def push(expression); $stack << expression; end
def unary; -> { push(yield pop) }; end
def binary; -> { push(yield pop, pop) }; end
def unary_boolean; -> { push(if yield pop then 1 else 0 end) }; end
def binary_boolean; -> { push(if yield pop, pop then 1 else 0 end) }; end
def swap; $stack[-2,2] = $stack[-2,2].reverse; end
$stack = []
View lz77.c
/* PROG1.C */
/* Simple Hashing LZ77 Sliding Dictionary Compression Program */
/* By Rich Geldreich, Jr. October, 1993 */
/* Originally compiled with QuickC v2.5 in the small model. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/* set this to 1 for a greedy encoder */
View basic.asm
TITLE BASIC M6502 8K VER 1.1 BY MICRO-SOFT
SEARCH M6502
SALL
RADIX 10 ;THROUGHOUT ALL BUT MATH-PAK.
$Z:: ;STARTING POINT FOR M6502 SIMULATOR
ORG 0 ;START OFF AT LOCATION ZERO.
SUBTTL SWITCHES,MACROS.
REALIO=4 ;5=STM
View maze-generation
(require '[clojure.string :as s])
;; Maze GENERATION
(defn north-of [[row col]] [(dec row) col])
(defn south-of [[row col]] [(inc row) col])
(defn west-of [[row col]] [row (dec col)])
(defn east-of [[row col]] [row (inc col)])
(defn neighbours [rows cols cell]
You can’t perform that action at this time.