- class.cColor.php : CSSなどで、色味を統一させるために、色相を保ったまま、明度の変更、色の混合、色の強調、ウェエブセーフカラーなどに変換するクラスです。
- function.file_get_googletext.php : 一般公開されたGoogle文書をSmartyなどのテンプレート・エンジンのテンプレートとして使うために、テキストの文字列として返す関数。
# bashの「ターミナル」対応 | |
# 作業ディレクトリ(ワーキング・ディレクトリ) | |
# | |
# ターミナルに現在の作業ディレクトリを、プロンプトごとに伝える | |
if [ -z "$INSIDE_EMACS" ]; then | |
update_terminal_cwd() { | |
# "file:"のURLスキームを使ってディレクトリを特定する。 |
<?php | |
/** | |
* Returns the check sum digit according to JAN code regulation. | |
* About JAN code : http://www.dsri.jp/jan/check_digit.html | |
* | |
* @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 ))); |
<?php | |
/* ========================================================================= | |
Sample usage | |
of | |
KEINOS_DB class | |
https://gist.github.com/KEINOS/873269390bc6c9c0cb724dd52170ea9f | |
========================================================================= */ | |
// Flag for debugging. Nothing important for the sample. See `debug_echo` |
public class compiler | |
' See sample work at | |
' https://paiza.io/projects/uoJ2-cB4Os76jMK-O11Csw | |
shared function Main as integer | |
' MD5ハッシュ値を計算したい文字列 | |
Dim s As String = "sample text" | |
' MD5の結果を表示 | |
Console.WriteLine ( md5( s ) ) |
[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' |
[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' | |
/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/ac |
<style type="text/css"> | |
.debug { | |
width:100%; | |
font-size:16px; | |
/* See the PostScriptName of the font info at FontBook app */ | |
font-family:"RictyDiminishedDiscord-Regular"; | |
overflow: auto; | |
white-space: pre-wrap; | |
word-wrap: break-word; | |
} |
#!/bin/bash | |
# | |
# @sacloud-once | |
# @sacloud-desc-begin | |
# このスクリプトはmastodonをセットアップします。 | |
# (このスクリプトは、CentOS7.Xでのみ動作します。) | |
# | |
# 事前作業として以下の2つが必要となります | |
# ・さくらのクラウドDNSにゾーン登録を完了していること | |
# ・さくらのクラウドAPIのアクセストークンを取得していること |
[root@ixx-xxx-xxxxx ~]# cd ~/ | |
[root@ixx-xxx-xxxxx ~]# | |
[root@ixx-xxx-xxxxx ~]# # Update yum skip to line 2838 | |
[root@ixx-xxx-xxxxx ~]# yum -y update | |
Loaded plugins: fastestmirror, langpacks | |
base | 3.6 kB 00:00:00 | |
epel/x86_64/metalink | 5.0 kB 00:00:00 | |
epel | 4.3 kB 00:00:00 | |
extras | 3.4 kB 00:00:00 | |
updates | 3.4 kB 00:00:00 |