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
diff --git a/lib/mkmf.rb b/lib/mkmf.rb | |
index 7e40c2d..a6299a0 100644 | |
--- a/lib/mkmf.rb | |
+++ b/lib/mkmf.rb | |
@@ -6,6 +6,61 @@ | |
require 'rbconfig' | |
require 'fileutils' | |
require 'shellwords' | |
+require "pp" | |
+require "open3" |
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
# Usage: | |
# $ make | |
# $ make install | |
# $ ./ruby test_gem.rb test GEM_NAME | |
require "rbconfig" | |
require "rubygems" | |
require "rubygems/gem_runner" | |
require "rubygems/exceptions" | |
require "yaml" |
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
#!/bin/bash | |
set -eux | |
cd out # deploy directory | |
git init . | |
git config --local user.name USER | |
git config --local user.email [email protected] | |
git checkout -b gh-pages |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Base64 Encoding Performance</title> | |
</head> | |
<body> | |
<p id="counter"></p> | |
<input type="file" id="dialog" multiple> |
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 "kmeans-clusterer" | |
require "natto" | |
class WordDic | |
class << self | |
def [](word) | |
dictionary[word] ||= next_index | |
end | |
def size |
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
#include <stdio.h> | |
int main(void) { | |
printf("Hello, world!"); | |
return 0; | |
} | |
/* | |
$ gcc -c hello.c | |
$ gobjdump -d -M intel hello.o |
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
#!/usr/bin/env ruby | |
$LOAD_PATH.unshift("../../lib", __FILE__) | |
require "./runner" | |
Takoyaki::Runner.new(ARGV).run |
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
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# Guess BigQuery table schema automatically from JSON Lines | |
# | |
# example: | |
# $ cat source.jsonl | |
# {"required":123,"optional":true,"nested":{"required":1234,"optional":"yes"},"array":[0,1,2,3,4]} | |
# {"required":456,"optional":false,"nested":{"required":1234,"optional":"yes","nested":{"prop":1}},"array":[5,6,7,8,9]} | |
# {"required":789,"nested":{"required":1234,"optional":"yes","additional":"added"},"array":[]} |
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
# frozen_string_literal: true | |
require "sinatra" | |
module Sinatra | |
module Mount | |
def mount(app, path = "/#{app.name.downcase}") | |
%i(get post put delete patch options).each do |method| | |
self.send(method, "#{path}*") do | |
app.call( |
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
# frozen_string_literal: true | |
require 'google/apis/analytics_v3' | |
require 'google/api_client/auth/key_utils' | |
module GoogleServices | |
class Analytics | |
attr_reader :start_date, :end_date | |
def initialize(start_date: nil, end_date: nil) |