Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block KEINOS

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Last active Aug 22, 2019
GAS(Google Apps Script) user function to get MD5 hash or 4digit shortened hash for Multibyte(UTF-8, 2bytes character) environment.
* ------------------------------------------
* MD5 function for GAS(GoogleAppsScript)
* You can get a MD5 hash value and even a 4digit short Hash value of a string.
* ------------------------------------------
* Usage1:
* `=MD5("YourStringToHash")`
* or
* `=MD5( A1 )` with the same string at A1 cell
KEINOS / fArray_merge.php
Last active May 29, 2017
View fArray_merge.php
function fArray_merge($aOld, $aNew)
if (is_array($aOld)) {
if (is_array($aNew)) {
foreach ($aNew as $sKey => $mValue) {
if (isset($aOld[$sKey]) && is_array($mValue) && is_array($aOld[$sKey])) {
$aOld[$sKey] = fArray_merge($aOld[$sKey], $mValue);
} else {
$aOld[$sKey] = $mValue;
KEINOS / log_error_minecraft_launcher-helper_20170603.log
Created Jun 3, 2017
Crash report (error log) of "Minecraft Launcher Helper" on macOS Sierra (OSX 10.12.5)
View log_error_minecraft_launcher-helper_20170603.log
「launcher Helperの問題レポート」
「launcher Helperが予期しない理由で終了しました。」(Minecraft Launcher quit unexpectedly.)
Process: launcher Helper [83464]
Path: /Applications/ Helper
Identifier: com.mojang.mclauncher.helper
Version: ???
Code Type: X86-64 (Native)
Parent Process: launcher [83459]
Responsible: launcher Helper [83464]
Last active Jun 5, 2017
[IN PROGRESS] Bash file's comments translation in Japanese at '/etc/bashrc_Apple_Terminal'. [macOS Sierra( OSX 10.12 )]
# bashの「ターミナル」対応
# 作業ディレクトリ(ワーキング・ディレクトリ)
# ターミナルに現在の作業ディレクトリを、プロンプトごとに伝える
if [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# "file:"のURLスキームを使ってディレクトリを特定する。
KEINOS / function.checkDigit.php
Last active Jun 11, 2017
JANコード(バーコード)のチェック・デジット算出用PHP関数。Simple function that returns the check digit for JAN, ITF, UCP code. About JAN code see:
View function.checkDigit.php
* Returns the check sum digit according to JAN code regulation.
* About JAN code :
* @param {string} $s number or string
* @return {integer} One digit number
function checkDigit( $s ){
$a = array_merge( array(0), array_map( function($v){ return is_numeric( $v ) ? $v : bin2hex($v); }, str_split( $s )));
KEINOS / Sample.php
Last active Jul 19, 2017
Simple PHP function to encode decimal numbers to Nth base.
View Sample.php
// Input string
$s = 'This is a sample string to be hashed.';
// Output
echo $s . PHP_EOL; // 'This is a sample string to be hashed.'
echo md5($s) . PHP_EOL; // 'baad33e1e97f316b9750c27c86bf64d6'
KEINOS / File1
Last active Jun 12, 2017
配列のように、SQLite3クラスを使用するためのシンプルなクラスです。Simple class for use of the SQLite3 class, as easy like an array.
View File1
/* =========================================================================
Sample usage
========================================================================= */
// Flag for debugging. Nothing important for the sample. See `debug_echo`
KEINOS / Main.vb
Last active Jun 12, 2017
Sample VB script function to get MD5 hash value from a string.
View Main.vb
public class compiler
' See sample work at
shared function Main as integer
' MD5ハッシュ値を計算したい文字列
Dim s As String = "sample text"
' MD5の結果を表示
Console.WriteLine ( md5( s ) )
KEINOS / log_error_centOS7_mastodon_rake_secret.log
Last active Jun 17, 2017
Error log of `rake secret` on CentOS7 while installing Mastodon. If you're getting this error try `$ RAILS_ENV=production bundle exec rake secret` to get the secret key.
View log_error_centOS7_mastodon_rake_secret.log
[mastodon@myserver live]$ export SECRET_KEY_BASE=$(bundle exec rake secret)
rake aborted!
NameError: uninitialized constant Annotate
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `block in load_missing_constant'
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:11:in `block in with_bootsnap_fallback'
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:17:in `without_bootsnap_cache'
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:11:in `rescue in with_bootsnap_fallback'
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:6:in `with_bootsnap_fallback'
KEINOS / log_error_centOS7_mastodon_rails_db_setup.log
Created Jun 16, 2017
Error log of CentOS7 while installing mastodon when `rails db:setup`
View log_error_centOS7_mastodon_rails_db_setup.log
[mastodon@myserver live]$ RAILS_ENV=production bundle exec rails db:setup
Database 'mastodon' already exists
rails aborted!
Devise.secret_key was not set. Please add the following to your Devise initializer:
config.secret_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Please ensure you restarted your application after installing Devise or setting the key.
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/devise-4.3.0/lib/devise/rails/routes.rb:498:in `raise_no_secret_key'
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/devise-4.3.0/lib/devise/rails/routes.rb:226:in `devise_for'
You can’t perform that action at this time.