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 'openssl' | |
require 'cgi' | |
require 'base64' | |
# see https://developer.twitter.com/ja/docs/authentication/oauth-1-0a/creating-a-signature | |
module Oauth1_0a | |
class Authorization | |
attr_accessor :http_method, :url, :consumer_key, :consumer_secret, :token, :token_secret, :nonce, :timestamp | |
def initialize(http_method:, url:, consumer_key:, consumer_secret:, token:, token_secret:) |
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
module Akaden | |
module Station | |
STATIONS = %w(shin_hamamatsu daiichi_dori kamijima).freeze | |
end | |
class Info | |
class << self | |
include Station | |
STATIONS.each do |station| |
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
module Akaden | |
STATIONS = %w(DaiichiDori Kamijima) | |
module InfoLoadable | |
def do_info | |
"#{station} info!" | |
end | |
end | |
module TimetableLoadable |
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 'fileutils' | |
class DuplicateFileCleaner | |
class << self | |
def run(dir: '', extname: 'txt', dryrun: false) | |
self.new(extname, dryrun).cleanup(dir) | |
end | |
end | |
def initialize(extname, dryrun) |
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 node:10.16.3-alpine | |
WORKDIR /app | |
RUN apk update && \ | |
npm install -g npm @vue/cli |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: --- | |
create IAM user only access S3 bucket | |
# validate | |
- aws cloudformation validate-template --template-body file://template.yml | |
# crete stack | |
- aws cloudformation create-stack --stack-name S3IAMUser --template-body file://template.yml --capabilities CAPABILITY_NAMED_IAM |
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 'test/unit' | |
# Array#override | |
# | |
# [0, 0, 0, 0, 0].override(['a', 'b']) | |
# => ['a', 'b', 0, 0, 0] | |
# | |
# [0, 0, 0, 0, 0].override(['a', 'b'], 2) | |
# => [0, 0, 'a', 'b', 0] |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: "App Name", | |
params: [], | |
// paramsより後に定義すると、値が正しく判定されない | |
isFiltered: Ember.computed.or('params', 'appName'), | |
}); |
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
const AWS = require('aws-sdk'); | |
const dynamoDb = new AWS.DynamoDB.DocumentClient({ | |
region: "ap-northeast-1" | |
}); | |
// exports.handler = (event, context, callback) => { | |
// const data = { | |
// name: "yuto", | |
// email: "jacoyutorius@gmail.com", |
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 main | |
lifegame = Lifegame.new(width: 100) | |
generation = 0 | |
loop do | |
# puts "Generation: #{generation} ---------------------------" | |
lifegame.draw | |
sleep 0.025 | |
generation += 1 | |
end |
NewerOlder