Skip to content

Instantly share code, notes, and snippets.

@nickjs
nickjs / CPBundle.sj
Created July 22, 2009 17:59
CPLocalizedString for Cappuccino
/*
* CPBundle.sj
* AppKit
*
* Created by Nicholas Small.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@vidarh
vidarh / closures-basic.c
Created December 18, 2009 12:10
A number of ways to implement closures in C, in preparation of an upcoming blog post
#include <stdio.h>
#include <stdlib.h>
struct closure {
void (* call)(struct closure *);
int x;
};
@Me1000
Me1000 / CPWindow+animations.j
Created April 22, 2011 18:08
Pretty window animations for Cappuccino CPWindow.
/*!
Created by Randy Luecke April 22nd 2011
Copyright RCLConcepts, LLC.
All right reserved.
This code is available under the MIT license.
*/
@ECHO OFF
REM -- Automates cygwin installation
SETLOCAL
REM -- Change to the directory of the executing batch file
CD %~dp0
REM -- Configure our paths
SET SITE=http://mirrors.kernel.org/sourceware/cygwin/
@zachstronaut
zachstronaut / gist:1184900
Created August 31, 2011 22:22
Stretch HTML5 canvas to fill window, preserving aspect ratio
/**
* fullscreenify()
* Stretch canvas to size of window.
*
* Zachary Johnson
* http://www.zachstronaut.com/
*
* See also: https://gist.github.com/1178522
*/
@xandkar
xandkar / fibs.erl
Last active October 5, 2017 09:37
Fibonacci versions in Erlang. Naively recursive, array and list.
%%%----------------------------------------------------------------------------
%%% $ erl -noshell -s fibs main 40
%%% TRANSLATED ARRAY: 102334155 0.001755 seconds
%%% TRANSLATED LIST: 102334155 0.000048 seconds
%%% REVERSE ORDER LIST: 102334155 0.000004 seconds
%%% MINIMAL ARITHMETIC: 102334155 0.000001 seconds
%%% NAIVE RECURSIVE: 102334155 8.383385 seconds
%%%----------------------------------------------------------------------------
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@gburd
gburd / async_nif.h
Last active October 3, 2023 05:12
Technique for running Erlang NIFs functions asynchronously, not on scheduler threads.
/*
* async_nif: An async thread-pool layer for Erlang's NIF API
*
* Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved.
* Author: Gregory Burd <greg@basho.com> <greg@burd.me>
*
* This file is provided to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
@sntran
sntran / elixir
Last active December 17, 2015 23:09
Dockerfile for Erlang container for Docker.IORename each of these to `Dockerfile` to build the imagedocker build -t="{imagename}" .docker run -i -t {imagename} /bin/bash
# Elixir on Erlang
#
# VERSION 0.13.2
FROM sntran/kerl
MAINTAINER Son Tran-Nguyen "me@sntran.com"
RUN apt-get install -y unzip
RUN mkdir -p /opt/erlang/elixir
RUN cd /opt/erlang/elixir && curl -L -O https://github.com/elixir-lang/elixir/releases/download/v0.13.2/Precompiled.zip && unzip Precompiled.zip
@pichi
pichi / fib.erl
Last active March 5, 2017 21:25
Big Fibonacci number generator in Erlang
%% Fibonacci number generator in Erlang
%% by Hynek Vychodil <vychodil.hynek@gmail.com> 3-JAN-2014
%% Distributed under MIT license at the end of the source code.
-module(fib).
-export([fib/1]).
% NOTE: Native compilation (HiPE) doesn't improve efficiency due heavy integer
% bignum computations as observed in R16