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
# cf. https://html-preview.github.io/?url=https://github.com/hashids/hashids.github.io/blob/master/index.html | |
require "hashids" | |
puts "Default alphabet length: #{Hashids::DEFAULT_ALPHABET.length}" | |
hashids = Hashids.new("This is salt", 10) | |
puts <<MSG | |
Alphabet: #{hashids.alphabet} | |
Alphabet length: #{hashids.alphabet.length} | |
Seps: #{hashids.seps} |
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 'csv' | |
require 'faker' | |
require 'google/cloud/bigquery' | |
PROJECT_ID = ENV['PROJECT_ID'] | |
DATASET_ID = ENV['DATASET_ID'] | |
TABLE_ID = 'json_extract_benchmark' | |
bigquery = Google::Cloud::Bigquery.new(project_id: PROJECT_ID) |
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 'test/unit/ui/console/testrunner' | |
class TestUnitProfiler | |
Record = Struct.new(:test_name, :test_class, :start_time, :self_time, :total_time, :children, keyword_init: true) do | |
def to_h | |
{ | |
name: test_name, | |
class: test_class, | |
self: self_time, | |
total: total_time, |
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 -eo pipefail | |
image_id=$1 | |
if [ -z "$image_id" ]; then | |
echo "Usage: $(basename $0) IMAGE_ID" | |
exit 1 | |
fi |
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 -eu | |
PANE_MINIMUM=2 | |
usage() { | |
cat <<USAGE | |
Usage: $(basename $0) [-c COL] [-r ROW] [--ssh-option SSH_OPTIONS] HOST [HOST2 ...] |
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
# @example | |
# class Setting | |
# include BitfieldBindable | |
# bind_bitfield :feature_bits, :features, 0 => "foo", 1 => "bar" | |
# | |
# attr_accessor :feature_bits | |
# def initialize | |
# @feature_bits = 0 | |
# end | |
# end |
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
# @example | |
# class User < ApplicationRecord | |
# include HasSetting | |
# has_setting :setting, :user_setting_item | |
# end | |
# | |
# # == Schema Information | |
# # | |
# # Table name: user_settings | |
# # |
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
# Copyright 2015- Takeshi Arabiki | |
# License: MIT License (http://opensource.org/licenses/MIT) | |
library(data.table) | |
access_logs <- (function() { | |
set.seed(0) | |
USER_COUNT <- 10000 | |
PAGES <- c("page1", "page2", "page3") |
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
--- export.i.orig 2011-07-05 11:23:42.000000000 +0900 | |
+++ export.i 2015-04-11 19:19:39.000000000 +0900 | |
@@ -8,12 +8,13 @@ | |
%include "std_vector.i" | |
%include "exception.i" | |
+%feature("director") Trainer; | |
+%include "crfsuite_api.hpp" | |
+ | |
%template(Item) std::vector<CRFSuite::Attribute>; |
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
# Copyright 2015- Takeshi Arabiki | |
# License: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html> | |
library(Rcpp) | |
Sys.setenv(PKG_LIBS = "-lpcrecpp") | |
sourceCpp(code = ' | |
#include <Rcpp.h> // Rcpp 0.11.3 | |
#include <pcrecpp.h> // pcrecpp 8.36 | |
// [[Rcpp::export]] |
NewerOlder