Skip to content

Instantly share code, notes, and snippets.

@keeto
keeto / vim.rb
Created May 13, 2012 10:55 — forked from uasi/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.480'
def features; %w(tiny small normal big huge) end
@keeto
keeto / Element.insertHTML.js
Created December 2, 2011 15:37
Element.insertHTML
/*
---
name: Element.injectHTML
description: Wrapper/polyfill around insertAdjacentHTML.
license: MIT-style license
copyright: Copyright (c) 2011 Mark Obcena <keetology.com>
/* XML Methods for MooTools */
/* Requires MooTools v1.3 */
var XML = {
rootFromFile: function(file){
var root = null;
switch (Browser.name){
case 'safari':
case 'chrome':
/*
Script: Core.js
Examples for Core.js
License:
MIT-style license.
*/
describe('Function.prototype.extend', {
@keeto
keeto / Function.Typed.js
Created June 27, 2010 06:49
Function.Typed: MultiMethod Helper
/*
Script: Function.Typed.js
Helper for multimethods.
Copyright and License:
Copyrighted 2010, Mark Obcena. MIT-Style License
Credits:
Inspired by "Multimethods in Python"
[http://alexgaynor.net/2010/jun/26/multimethods-python/]
@keeto
keeto / Mediator.js
Created June 26, 2010 17:40
Mediator: Object grouping and brokering
/*
Script: Mediator
Object grouping and brokering
Copyright and License:
Copyright 2010, Mark Obcena. MIT-Style License
*/
(function(){
@keeto
keeto / Class.mock.js
Created May 25, 2010 19:15
Class.mock Generic for MooTools
Class.extend({
mock: function(klass, options){
options = options || {};
klass = klass.prototype;
var proto = {};
for (var i in klass) (function(key, value){
proto[key] = options[key];
if (proto[key]) return;
switch ($type(value)){
case 'function':
/*
Script: Template.jx
Basic templating system.
License:
MIT-style license.
Acknowledgements:
Original inspired by Charlie Savages' simple templating engine.
@keeto
keeto / Function.docStringMethod.js
Created April 2, 2010 07:20
Function docStrings in JavaScript
// As a Function method..
(function(){
Function.prototype.docString = function(){
var doc = this[this.toSource ? 'toSource' : 'toString']().match(/['"]\*(.*)\*['"]/);
return (doc) ? doc[1].replace(/^\s+|\s+$/g, '') : '';
};
})();
@keeto
keeto / Signal.js
Created January 27, 2010 15:49
Signal.js: Makes chaining functions easy!
/*
Script: Signal.js
Makes chaining functions easy!
License & Copyright:
Copyright 2009, Mark Obcena <keetology.com>
MIT-Style License
*/
(function(global){