Skip to content

Instantly share code, notes, and snippets.

;;; hide-comnt.el --- Hide/show comments in code.
;;
;; Filename: hide-comnt.el
;; Description: Hide/show comments in code.
;; Author: Drew Adams
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
;; Copyright (C) 2011-2014, Drew Adams, all rights reserved.
;; Created: Wed May 11 07:11:30 2011 (-0700)
;; Version: 20131227.116
;; X-Original-Version: 0
require 'slippery'
require 'fileutils'
require 'tempfile'
require_relative 'watch_task'
namespace :slippery do
extend Slippery::ProcessorHelpers::ClassMethods
NAME = 'learn_to_learn'
$namespaces = []
def namespace(name, &blk)
$namespaces << Namespace.new(name, &blk)
end
class Namespace
def initialize(name, &blk)
@name = name
@thingies = []
# Tea timer
Shoes.app do
@time = 0
@backgrounds = []
@colors = {
white: '#ffffff',
green: '#00ff00',
red: '#ff0000',
#!/usr/bin/env node
// Call like : node saving_time.js 9:00
/*
Idea taken from http://codegolf.com/saving-time
Take an input representing a time, like 22:15 or 04:23, and draw a clock indicating
hours and minutes, like below.

Arne Brasseur

Contact details

Speaker bio

Arne is a developer, public speaker, programming coach, author and open-source contributor. With a passion for both human and programming languages, he has spent the last decade teaching and exploring the finer points of Ruby, LISP, Haskell, Mandarin Chinese, and others.

require 'kramdown'
class ShoesDown
attr_reader :app, :kramdown_document, :type, :value, :attr, :children, :options
def initialize(markdown)
@kramdown_document = Kramdown::Document.new(markdown, input: 'GFM')
end
def draw(app)
diff --git i/vm_opts.h w/vm_opts.h
index b67e254..3e3935a 100644
--- i/vm_opts.h
+++ w/vm_opts.h
@@ -18,8 +18,8 @@
* Following definitions are default values.
*/
-#define OPT_TRACE_INSTRUCTION 1
-#define OPT_TAILCALL_OPTIMIZATION 0

Get your own Tail-call Optimized Ruby with this one weird ruby-install command.

CONFIGURE_OPTS="--disable-install-rdoc" ruby-install -p https://gist.githubusercontent.com/plexus/11201946/raw/517cc64511146454f7a066eb40132a6e898241c0/enable_tco.diff  -p https://gist.githubusercontent.com/plexus/10021256/raw/9d9edf8d4f03643c7dce4d52c576ad40f2a01760/ruby-2.1.1-readline.patch -i ~/.rubies/ruby-2.1.1-tco ruby 2.1

I had to disable rdoc generation because for whatever reason it segfaulted, you might be able to leave off that CONFIGURE_OPTS. The first patch enables TCO, and is nothing more than

diff --git i/vm_opts.h w/vm_opts.h