Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Seaton chrisseaton

View GitHub Profile
View gist:4f76d71d03f9b16dd2d06e93b06e7995
Last login: Thu Jan 28 11:21:47 on ttys001
chrisseaton@Chris-Seatons-MacBook-Pro ~ % cd Desktop
chrisseaton@Chris-Seatons-MacBook-Pro Desktop % git clone https://github.com/graalvm/mx
Cloning into 'mx'...
remote: Enumerating objects: 96, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 13881 (delta 48), reused 74 (delta 26), pack-reused 13785
Receiving objects: 100% (13881/13881), 28.44 MiB | 8.07 MiB/s, done.
Resolving deltas: 100% (7826/7826), done.
View gist:a7d96d389cd14a536665b4560c8447b0
This file has been truncated, but you can view the full file.
truffleruby (Shopify) 20.2.0-dev-979b9739, like ruby 2.6.6, GraalVM CE Native [x86_64-darwin]
RUBYOPT: -rbundler/setup
Puma::MiniSSL OpenSSL
OPENSSL_LIBRARY_VERSION: OpenSSL 1.1.1g 21 Apr 2020 OpenSSL 1.1.1g 21 Apr 2020
OPENSSL_VERSION: OpenSSL 1.1.1g 21 Apr 2020 OpenSSL 1.1.1g 21 Apr 2020
Run options: --seed 34960
# Running:
View acid.rb
require 'benchmark/ips'
module Foo
extend self
def foo(a, b, c)
hash = {a: a, b: b, c: c}
array = hash.map { |k, v| v }
x = array[0]
y = [a, b, c].sort[1]
View test.rb
def fizzbuzz(n)
if n % 3 == 0 && n % 5 == 0
'FizzBuzz'
elsif n % 3 == 0
'Fizz'
elsif n % 5 == 0
'Buzz'
else
n
end
View test.js
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('<h1>Hello!</h1>');
});
app.listen(8080, function () {
console.log('serving at http://localhost:8080')
});
View gist:5ef145aa1a40269c919bff8ea75aefb1
== Preparing database ==
The Rubinius process is aborting with signal: SIGSEGV
--- begin system info ---
node: info: dhcp-10-175-175-229.vpn.oracle.com Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64
--- end system info ---
--- begin rubinius info ---
process: info: chrisseaton rbx 20461 3.107 2.3.1 2018-07-15 387c4887 5.0.1 JIT disabled
--- end rubinius info ---
--- begin system backtrace ---
0 ruby 0x000000010e529b07 _ZN8rubiniusL20abandon_ship_handlerEi + 247
View try.md
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

Warming up --------------------------------------
                 old   136.393k i/100ms
                 new   166.558k i/100ms
Calculating -------------------------------------
                 old      2.057M (± 1.6%) i/s -     10.366M in   5.040331s
                 new      2.760M (± 1.9%) i/s -     13.824M in   5.010739s
View gist:19d8bea4f71bdbf1744167e732dd28b9
main # Rubinius::Loader at core/loader.rb:852 (+90)
script # Rubinius::Loader at core/loader.rb:667 (+343)
load_script # Rubinius::CodeLoader at core/code_loader.rb:280 (+60)
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at core/code_loader.rb:119 (+81)
run_script # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at core/code_loader.rb:132 (+21)
__script__ # Object at /Users/chrisseaton/.rbenv/versions/rbx-3.105/bin/kramdown:23 (+197)
load # Kernel(Object) at core/kernel.rb:578 (+49)
load # Rubinius::CodeLoader at core/code_loader.rb:287 (+64)
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::CodeModule) at core/code_loader.rb:119 (+81)
run_script # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::CodeModule) at core/code_loader.rb:132 (+21)
View gist:29d1ee2916ee5c0dd2a822051dfa2c08
Updating Homebrew...
==> Tapping rubinius/apps
Cloning into '/usr/local/Homebrew/Library/Taps/rubinius/homebrew-apps'...
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 20 (delta 14), reused 14 (delta 13), pack-reused 0
Unpacking objects: 100% (20/20), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/rubinius/homebrew-apps/rubinius-2.3.0.rb
uninitialized constant #<Class:0x00007f9a1d0a8e80>::MinimumMacOSRequirement
Did you mean? MaximumMacOSRequirement
View enumerator.rb
string = 'hello'
enumerators = []
loop do
1000.times do
e = string.each_byte
e.next # Has to create a fiber to run `each_byte` in
# so it can pause in the method waiting for
# you to call #next again.