Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrian Sinclair adrusi

View GitHub Profile
View command.js
var Kaffeine = require("./../lib/index"),
fs = require('fs'),
path = require('path'),
optparse = require('optparse'),
util = require("util"),
sources = [],
options = {},
oparser
@adrusi
adrusi / rpn.js
Created Jun 18, 2011
A full interpreter for an rpn-based language written in under 300 lines of javascript.
View rpn.js
#!/usr/bin/env node
var input = require("fs").readFileSync(
require("path").join(process.cwd(), process.argv[process.argv.length - 1]),
"utf8"
);
var gvars = {};
function exec(input, fns, vars) {
(function findStrs() {
var inStr = false;
@adrusi
adrusi / pure.js
Created Jun 5, 2011
Spec for an extension to javascript that makes it purely functional (with the exception of global variables)
View pure.js
define a = b, // global.a = b;
c = d; // global.c = d;
define f(x) { // global.f = function(x) {
// return;
} // }; global.f.name = "f";
/* only globals can be reassigned, and only with the `define` keyword */
let (a = b, c = d) { // (function() { var a = b, c = d; (function(a, c) {
console.log(a, c); // return console.log(a, c);
@adrusi
adrusi / open_in_hashify.rb
Created May 15, 2011
TextMate command to open a markdown document in hashify.me
View open_in_hashify.rb
#!/usr/bin/env ruby
require "base64"
data = STDIN.read
%x[open http://hashify.me/#{Base64.encode64(data)}]
=begin
+-[ COMMAND SETTINGS ]------------+
| Save: nothing |
| Input: entire document |
@adrusi
adrusi / Alumina UI.html
Created Jan 31, 2011
A massive collection of UI elements in CSS3. Webkit only.
View Alumina UI.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>UI Kit</title>
<style>
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
View _vars.sass
$button-top-left-border: #cccccc
$button-bottom-right-border: #bbbbbb
$button-top-background: #f9f9f9
$button-bottom-background: #e3e3e3
$button-text-color: #000000
$button-active-top-left-border: #555555
$button-active-bottom-right-border: #444444
$button-active-top-background: #666666
$button-active-bottom-background: #7c7c7c
$button-active-text-color: #ffffff
View ttv2.css
[data-tooltip], .tooltip {
text-decoration: none!important;
border-bottom: 3px double black;
margin-bottom: -3px;
position: relative;
white-space: nowrap;
}
@-moz-document url-prefix() {
[data-tooltip], .tooltip, [data-tooltip] a, .tooltip a {
display: inline-block;
@adrusi
adrusi / orthographic.html
Created Dec 22, 2010
css3 & js orthographic drawing library
View orthographic.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
body {
font-family: "Helvetica Neue", Helvetica, sans-serif;
}
input[type=range] {
View minima.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lt IE 7]>
<script>
@adrusi
adrusi / template.php
Created Nov 26, 2010
cl_GTD Theme Template
View template.php
<?php
$themes[] = "Theme Name";
$theme_name["task divider"]["foreground"] = "color";
$theme_name["task divider"]["background"] = null;
$theme_name["id"]["foreground"] = null;
$theme_name["id"]["background"] = null;
$theme_name["title"]["foreground"] = null;