This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "faceAnnotations", | |
"type": "RECORD", | |
"mode": "REPEATED", | |
"fields": [ | |
{ | |
"name": "boundingPoly", | |
"type": "RECORD", | |
"mode": "NULLABLE", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
require "yaml" | |
def type(value, key) | |
case value | |
when Float | |
"FLOAT" | |
when Integer | |
"INTEGER" | |
when String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "coreaudio" | |
require "socket" | |
serv = TCPServer.new(9999) | |
sock = serv.accept | |
puts "accepted." | |
dev = CoreAudio.default_output_device | |
buf = dev.output_buffer(4096) | |
puts "output to device: #{dev.inspect}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. ruby extconf.rb | |
2. make | |
3. ruby test11328.rb | |
4. watch memory usage of 3. process | |
You should reproduce Makefile (step 1) if you try another version of ruby. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/.bundle | |
/vendor/bundle | |
/.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "google-api-client", "0.8.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'activesupport' | |
require "psych" | |
p Psych.respond_to?(:load_file) # => should print "true" but print "false" when psych-2.0.11.gem was installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
Const = lambda{ p [ :in_lambda, self, @foo ] } | |
define_method(:meth) do | |
p [:in_method, self, @foo] | |
Const.call | |
end | |
def initialize | |
@foo = 72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% make prereq | |
making srcs under enc | |
make[1]: Nothing to be done for `srcs'. | |
generating transdb.h | |
transdb.h unchanged | |
generating ../ruby/ext/ripper/ripper.c | |
extracting ripper.y from ../../parse.y | |
id.h not found in ["../.."] | |
make[1]: *** [ripper.y] Error 1 | |
make: *** [../ruby/ext/ripper/ripper.c] Error 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
class << self | |
def foo | |
p B | |
end | |
end | |
B = "A::B" | |
end |