Skip to content

Instantly share code, notes, and snippets.

View rickhull's full-sized avatar

Rick Hull rickhull

View GitHub Profile
gggI trained Aikido for many years. About the third year, I began a very basic rings routine coupled with running two miles per day. The running meant I no longer ran out of breath during class unless I was testing. The rings meant my hip speed was faster than ever before and I could counter just about every attack with a level of comfort I never had before the rings.
Because my core was so stable and strong, when I turned my hips, my feet and shoulders moved at the same time, like a door. Long lanky me became super quick for the first time in my life. Better shape and posture than in college basketball. Still skinny, but deceptively strong, even at extreme angles.
No injuries to shoulders and a chronic back pain between my shoulder blades went away (shiatsu also played a roll in the pain going away).
What was my ring routine? Dead hangs every day, adding a second a day (that's all; one second) until I could hang for two minutes. This took a few months.
Then I started over with one arm dead hangs until e
class Foo
def initialize
@foo = :foo
end
private
def bar
:bar
end
# normal nesting
module Outer
X = 1
Y = 2
class C
X = Y
end
end
# alternative nesting
def self.def_builtin_commands(delegation_class, command_specs)
for meth, args in command_specs
arg_str = args.collect{|arg| arg.downcase}.join(", ")
call_arg_str = args.collect{
|arg|
case arg
when /^(FILENAME.*)$/
format("expand_path(%s)", $1.downcase)
when /^(\*FILENAME.*)$/
# \*FILENAME* -> filenames.collect{|fn| expand_path(fn)}.join(", ")
rwh@DESKTOP-VA6OTK5:/mnt/c/Users/Rick/git/mruby_tools/mruby$ ruby minirake --trace
(in /mnt/c/Users/Rick/git/mruby_tools/mruby)
/mnt/c/Users/Rick/git/mruby_tools/mruby/tasks/toolchains/gcc.rake:38: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mrbc
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mirb
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mruby
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mruby-strip
/mnt/c/Users/Rick/git/mruby_tools/mruby/bin/mrdb
/mnt/c/Users/Rick/git/mruby_tools/mruby/build/test/bin/mirb
/mnt/c/Users/Rick/git/mruby_tools/mruby/build/test/bin/mruby
class Character
def self.generate_upp
6.times.reduce('') { |memo, _|
memo + Dice.roll_dice(6,2,1).to_s(16).upcase
}
end
end
begin
require 'flay_task'
FlayTask.new do |t|
t.dirs = ['lib']
t.verbose = true
end
rescue LoadError
warn 'flay_task unavailable'
end
module CompSci
# has a value and an array of children; allows child gaps
class Node
attr_accessor :value
attr_reader :children
def initialize(value, children: [])
@value = value
if children.is_a?(Integer)
@children = Array.new(children)
group "cpu" do
File.readlines("/proc/stat").grep(/^cpu/).each do |l|
name, user, nice, csystem, idle, iowait, irq, softirq = l.split(/\s+/).map(&:to_i)
total = busy + idle
counter "busy", value: busy, mute: true
counter "total", value: total, mute: true
gauge "usage" do
value("busy") / value("total") * 100
end
vagrant@contrib-jessie:~/git/mruby-tools (master)$ ./util.rb hello_world.rb goodbye_world.rb -o myprog
compiling...
created binary executable: myprog
vagrant@contrib-jessie:~/git/mruby-tools (master)$ file myprog
myprog: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=bb9af8c7a3aaedcb51da5b6aca8e0ba68d1f27f2, not stripped
vagrant@contrib-jessie:~/git/mruby-tools (master)$ ./myprog