Skip to content

Instantly share code, notes, and snippets.

@Yama-to
Yama-to / file0.txt
Last active October 4, 2020 03:13
RubyとPythonでGoogle APIを叩いてみた − データベースをSpreadsheetにしてGoogle Driveで管理する ref: http://qiita.com/Yama-to/items/74273213d5d89db7eb37
require 'google/apis/drive_v3'
require 'googleauth'
require 'googleauth/stores/file_token_store'
require 'fileutils'
credentials_dir = File.join(Dir.home, '.credentials')
CLIENT_SECRETS_PATH = File.join(credentials_dir, 'client_secret.json')
CREDENTIALS_PATH = File.join(credentials_dir, 'sampleApp.yaml')
OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'
@Yama-to
Yama-to / file0.rb
Last active November 12, 2015 05:16
AWSはこれで大丈夫|unicorn + nginx + capistrano + slackistrano のコマンド一覧 ref: http://qiita.com/Yama-to/items/1e1d889e6d5f7cc7f281
# connect to ec2
*[ ~ ] $: mv Downloads/tomajax.pem .ssh/
*[ ~ ] $: cd .ssh/
*[ .ssh ] $: chmod 600 tomajax.pem
*[ .ssh ] $: ssh -i tomajax.pem [email protected]
-----------------------------------------
# add user
[ec2-user|~]$ sudo adduser tomajax
[ec2-user|~]$ sudo passwd tomajax
@Yama-to
Yama-to / aws_manual.rb
Last active September 18, 2015 22:39
Deployment manual for AWS with Rails / unicorn / nginx / capistrano / slackistrano
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\ NOTES \\\\\
\\\\\ 1) commands with prefix[*] \\\\\
\\\\\ should be runned on local \\\\\
\\\\\ 2) remove '=begin' & '=end' \\\\\
\\\\\ before copy & paste codes \\\\\
\\\\\ 3) make sure to create your \\\\\
\\\\\ ec2 instance with linux \\\\\
\\\\\ 4) how to create vpc & ec2 \\\\\
\\\\\ ref: youtu.be/TDaLNHOL-h4 \\\\\
@Yama-to
Yama-to / file0.txt
Last active September 29, 2015 23:46
デザイナーに言われた「非デザイナーが気をつけるべきデザインの4原則」 ref: http://qiita.com/Yama-to/items/cb7f280b44a14c898418
近接の基本的な目的は「 組織化 」にあります。関連する要素を近づけてグループ化するだけで、自動的に組織構造が出来上がるのです。組織だてられた情報は、読まれやすくまた記憶にも残りやすくなります。
@Yama-to
Yama-to / application.css
Created August 8, 2015 21:11
あなたがRails触る人なら見ておきたい「体系的な」豆知識 ref: http://qiita.com/Yama-to/items/93cd8b3a8be67b09e353
/*
*= require_tree .
*= require_self
*/
@Yama-to
Yama-to / application_mailer.rb
Last active August 29, 2015 14:26
Railsでメール自動配信機能をつくるまでの道程 ref: http://qiita.com/Yama-to/items/823baf26bba3193712ea
class ApplicationMailer < ActionMailer::Base
default from: "メールテスト運営局",
bcc: "[email protected]",
reply_to: "[email protected]"
layout 'mailer'
end
@Yama-to
Yama-to / _comment.html.haml
Last active September 9, 2015 03:31
モモンガでも使えるAjax(えいじゃっくす) − 投稿したコメントをリロードせずに表示しよう ref: http://qiita.com/Yama-to/items/377f8a92cf30a3ebf454
-# 変更なし
@Yama-to
Yama-to / coffee
Last active August 29, 2015 14:26
JavaScriptを卒業してCoffeeScriptで飛躍しよう - 基本などまとめ ref: http://qiita.com/Yama-to/items/a947cfa2565b03ddc9de
class Fruit
constructor: (@name) ->
hello_world: -> alert "Hello #{@name}!"
class Apple extends Fruit
hello_world: -> super(); alert "...said Bob."
sungold = new Apple "SunGold"
sungold.hello_world()
@Yama-to
Yama-to / application.html.haml
Last active August 29, 2015 14:26
redirect_to使った時にBootstrap対応のフラッシュメッセージを表示させる ref: http://qiita.com/Yama-to/items/4d19a714d8bf5bfbabdd
%body
= render "layouts/header"
- flash.each do |key, value|
- key = "info" if key == "notice"
- key = "danger" if key == "alert"
= content_tag :div, value, class: "alert alert-#{key}"
= yield
= render "layouts/footer"
@Yama-to
Yama-to / input.yml
Last active August 29, 2015 14:25
YAMLとは何か? - いつもRailsの設定ファイルで出てくるやつの正体 ref: http://qiita.com/Yama-to/items/587544993fb62610528a
−−−
- d1
- d2
- d3
---
- x1
- x2
#=>
["d1", "d2", "d3"]
["x1", "x2"]