Skip to content

Instantly share code, notes, and snippets.

>> require 'benchmark'
=> true
>> Benchmark.measure { 1000000.times { a = /peoplel/}}.real
=> 0.199249029159546
>> Benchmark.measure { 1000000.times { a = Regexp.new("peoplel")}}.real
=> 4.74100685119629
>>
-module(echo_server).
-export([handle_event/3, handle_sync_event/4, init/1,
code_change/4, handle_info/3,
terminate/3]).
-export([start/0, start_fsm/1, loop/2]).
-define(TCP_OPTIONS, [binary, {packet, 0}, {active, false}, {reuseaddr, true}]).
CmdUtils.CreateCommand(
{
name: "erlang",
takes: {"function": noun_arb_text},
icon: "http://erlang.org/favicon.ico",
author: {name: "Jason Roelofs", email: "jameskilton@gmail.com"},
license: "MPL,GPL",
description: "Open erlang documentation for a given module",
help: "Select an erlang module",
execute: function(directObject)
>> require 'map'
=> true
>> m = Std::Map.new
=> #<Std::Map:0xb78aaa04>
>> m[0] = 1
=> 1
>> m.each { |x| p x }
[0, 1]
=> #<Std::Map:0xb78aaa04>
>> require 'sample_enum'
require 'test/unit'
class ShouldTest < Test::Unit::TestCase
def self.should(behave, &block)
mname = "test_should_#{behave}"
if block
define_method mname, &block
else
define_method mname do
CmdUtils.CreateCommand(
{
name: "rails",
takes: {"function": noun_arb_text},
icon: "http://ruby-doc.org/favicon.ico",
homepage: "http://jackndempsey.blogspot.com",
author: {name: "Jack Dempsey", email: "jack.dempsey@gmail.com"},
license: "MPL,GPL",
description: "Search rails functions documentation",
help: "Select a rails function",
" line/char info in lower right of screen
:set ruler
"Color scheme (use tab-completion to learn other options)
:colorscheme koehler
" syntax highlighting
:syntax on
"Share the system clipboard
" Make ',e' (in normal mode) give a prompt for opening files
" in the same dir as the current buffer's file.
if has("unix")
map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
else
map ,e :e <C-R>=expand("%:p:h") . "\\" <CR>
endif