$ nginx
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
package main | |
import ( | |
"fmt" | |
"log" | |
"flag" | |
"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
package main | |
import ( | |
"log" | |
"math" | |
) | |
func Round(val float64, roundOn float64, places int ) (newVal float64) { | |
var round float64 | |
pow := math.Pow(10, float64(places)) |
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 'mechanize' | |
name = "foo.html" | |
path = File.expand_path(name, __FILE__) | |
agent = Mechanize.new | |
page = agent.get("file://#{path}") |
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
とりあえずupdate | |
# sudo yum update -y | |
必要なもんを用意 | |
# wget https://mecab.googlecode.com/files/mecab-0.996.tar.gz | |
# wget https://mecab.googlecode.com/files/mecab-ipadic-2.7.0-20070801.tar.gz | |
解凍 | |
# tar xvfz mecab-0.996.tar.gz | |
# tar xvfz mecab-ipadic-2.7.0-20070801.tar.gz |
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
ActiveSupport.on_load :active_record do | |
module ActiveRecord::ConnectionAdapters | |
class AbstractMysqlAdapter | |
def create_table_with_innodb_row_format(table_name, options = {}) | |
table_options = options.merge(:options => 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC') | |
create_table_without_innodb_row_format(table_name, table_options) do |td| | |
yield td if block_given? | |
end | |
end | |
alias_method_chain :create_table, :innodb_row_format |
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
FROM java:7-jre | |
# grab gosu for easy step-down from root | |
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 | |
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ | |
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ | |
&& gpg --verify /usr/local/bin/gosu.asc \ | |
&& rm /usr/local/bin/gosu.asc \ | |
&& chmod +x /usr/local/bin/gosu |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"crypto/tls" | |
"crypto/x509" | |
) | |
func main() { | |
var rsaCertPEM = [] byte(`-----BEGIN CERTIFICATE----- | |
MIICEzCCAXygAwIBAgIQMIMChMLGrR+QvmQvpwAU6zANBgkqhkiG9w0BAQsFADAS |
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
// https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce | |
Date.prototype.toDatetimeLocal = | |
function toDatetimeLocal() { | |
var | |
date = this, | |
ten = function (i) { | |
return (i < 10 ? '0' : '') + i; | |
}, | |
YYYY = date.getFullYear(), | |
MM = ten(date.getMonth() + 1), |
OlderNewer