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 'big_query' | |
require 'twitter' | |
require 'pp' | |
class HTTP::URI | |
def port | |
443 if self.https? | |
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
require 'twitter' | |
require 'big_query' | |
# Twitter Gem のバグを回避 | |
class HTTP::URI | |
def port | |
443 if self.https? | |
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
require 'twitter' | |
require 'active_record' | |
ActiveRecord::Base.establish_connection( | |
adapter: 'mysql2', | |
host: 'localhost', | |
username: 'root', | |
database: 'twitter', | |
# For emoji | |
charset: 'utf8mb4', |
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
while (1) { | |
net use "\\192.168.xxx.xxx\share" | |
$filelist = Get-ChildItem \\192.168.xxx.xxx\share\video\ -filter *.m2ts | |
$num = $filelist | measure | |
$filecount = $num.count | |
$i = 0; | |
ForEach ($file in $filelist) | |
{ | |
$i++; | |
$oldfile = $file.DirectoryName + "\" + $file.BaseName + $file.Extension; |
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
# Change to match your CPU core count | |
workers 2 | |
# Min and Max threads per worker | |
threads 1, 6 | |
app_dir = File.expand_path("../..", __FILE__) | |
shared_dir = "#{app_dir}/shared" | |
# Default to production |
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
adduser alea12 | |
usermod -G root alea12 | |
# disable root login | |
# apt tools | |
sudo apt-get update | |
sudo apt-get install -y git nginx php5-fpm php5-cli libmysqld-dev mysql-server mysql-client php5-mysql php5-intl php5-mcrypt | |
sudo apt-get install -y zlib1g-dev build-essential libssl-dev libreadline-dev nodejs |
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 "google/api_client" | |
require "google_drive" | |
session = GoogleDrive.saved_session("config.json") | |
ws = session.spreadsheet_by_key("pz7XtlQC-PYx-jrVMJErTcg").worksheets[0] | |
# Gets content of A2 cell. | |
p ws[2, 1] #==> "hoge" | |
# Changes content of cells. | |
# Changes are not sent to the server until you call ws.save(). |
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 'google_drive' | |
require 'open-uri' | |
require 'nokogiri' | |
session = GoogleDrive::Session.from_config('config.json') | |
ws = session.spreadsheet_by_key('XXXXXXXXXXXXXXXXXXXXXXXXXX').worksheet_by_title('Sheet1') | |
urls = [ | |
'http://hanabi.walkerplus.com/list/ar0313/', | |
'http://hanabi.walkerplus.com/list/ar0313/2.html', |
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
test |
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
def is_kaibun?(str) | |
# 奇数長の文字列だった場合、真ん中の文字を削除 | |
if (str.length % 2) == 1 | |
str = str[0, (str.length/2)] + str[((str.length/2)+1), str.length] | |
end | |
str[0, (str.length/2)] === str[str.length/2, str.length].reverse | |
end | |