This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
function install_build_dependencies_ubuntu() { | |
sudo apt-get install -y \ | |
git ruby autoconf bison gcc make zlib1g-dev libffi-dev \ | |
libreadline-dev libgdbm-dev libssl-dev | |
} | |
function install_test_dependencies_ubuntu() { | |
sudo apt-get install -y \ |
This file contains hidden or 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
# ==== Emojis ==== | |
# 🌟 :sparkles: Adds a new feature or updates an existing feature | |
# 🐛 :bug: Fixes a bug | |
# ⚡ :zap: Improves performance of a feature | |
# 🔒 :lock: Fixes a security issue | |
# 🚿 :shower: Refactors an existing feature | |
# 👕 :tshirt: Fixes a code style violation | |
# 🔥 :fire: Deletes useless features, codes or files | |
# 📝 :pencil: Adds or updates a documentation | |
# 👮 :cop: Adds missing tests or correcs existing tests |
This file contains hidden or 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 | |
gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$') | |
[[ -z "${gofiles}" ]] && exit 0 | |
make pre-commit |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"golang.org/x/text/language" | |
"golang.org/x/text/message" | |
) |
This file contains hidden or 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 "color_echo" | |
patterns = { | |
/oldname/ => "newname", | |
} | |
skip_files = [ | |
/^\.git\//, |