Skip to content

Instantly share code, notes, and snippets.

@rubys
rubys / gist:dd96d4b2b834da1ad3b2
Created November 7, 2014 16:51
Add macro support to transformAnchors
# expand anchor 'macros'
for anchor in anchors[:]:
if 'url#' in anchor:
anchors.remove(anchor)
urlprefix = anchor['url#']
del anchor['url#']
linkingText = anchor.get('linkingText')
if isinstance(linkingText, list):
for link in linkingText:
anchor['linkingText'] = link
@rubys
rubys / anolis2bikeshed.rb
Created November 7, 2014 14:56
anolis2bikeshed.rb for URL Standard
src = Dir.chdir File.dirname(__FILE__) do
system 'git checkout url.src.html'
File.read('url.src.html')
end
# replace boilerplate with metadata
src.sub! /\A.*?\n<h2/m, <<-EOF + "\n<h2"
<pre class="metadata">
Title: URL Standard
Group: WHATWG
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: d48206e0d63fe34e22fa3248165340fdd513e8aa
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit haswell
OS X: 10.9.3-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
UID PID PPID C STIME TTY STAT TIME CMD
rubys 14214 14213 0 11:13 ? S 0:00 bash /home/rubys/.rvm/scripts/db /home/rubys/.rvm/user/db _
rubys@rubix:~$ ps -f 14213
UID PID PPID C STIME TTY STAT TIME CMD
rubys 14213 14191 0 11:13 ? S 0:00 bash /home/rubys/.rvm/scripts/db /home/rubys/.rvm/user/db _
rubys@rubix:~$ ps -f 14191
UID PID PPID C STIME TTY STAT TIME CMD
rubys 14191 14190 0 11:13 ? S 0:00 bash /home/rubys/.rvm/scripts/db /home/rubys/.rvm/user/db _
rubys@rubix:~$ ps -f 14191
UID PID PPID C STIME TTY STAT TIME CMD
@rubys
rubys / watch.rb
Created September 22, 2013 13:54
#!/usr/bin/ruby
require 'wunderbar/opal-jquery'
require 'nokogumbo'
_html do
_head do
_title 'Various stats'
end
_body do
@rubys
rubys / gist:6651139
Last active December 23, 2015 14:49
#!/usr/bin/ruby
require 'wunderbar/opal-jquery'
require 'nokogumbo'
_html do
_head do
_title 'Various stats'
end
_body do
#!/usr/bin/ruby
$:.unshift '/home/rubys/git/wunderbar/lib'
$:.unshift '/home/rubys/git/opal/lib'
$:.unshift '/home/rubys/git/opal-browser/lib'
### what "require 'wunderbar/opal-browser'" will ultimately do for you:
require 'wunderbar/opal'
require 'opal/browser'
ruby-head-n42891 - install
sh: 1: [[: not found
sh: 1: [[: not found
sh: 1: [[: not found
sh: 1: [[: not found
sh: 1: [[: not found
sh: 1: [[: not found
sh: 1: [[: not found
Warning! Requested ruby installation which requires another ruby available - installing one first.
Running(6): curl --fail --location --max-redirs 10 https://get.rvm.io
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
100 184 100 184 0 0 32 0 0:00:05 0:00:05 --:--:-- 450
100 184 100 184 0 0 32 0 0:00:05 0:00:05 --:--:-- 449
100 184 100 184 0 0 15 0 0:00:12 0:00:11 0:00:01 15
100 184 100 184 0 0 14 0 0:00:13 0:00:12 0:00:01 0
Version: 4.0.7
Date : 2013-07-07 13:27:35 -0400
--------- Apache processes ----------
PID PPID VMSize Private Name
-------------------------------------
1726 1 97.3 MB 0.6 MB /usr/sbin/apache2 -k start
12500 1726 96.8 MB 0.6 MB /usr/sbin/apache2 -k start
12542 1726 697.7 MB 1.0 MB /usr/sbin/apache2 -k start
12543 1726 505.5 MB 0.7 MB /usr/sbin/apache2 -k start