Skip to content

Instantly share code, notes, and snippets.

@externvoid
externvoid / renameXcodeProject.sh
Last active December 7, 2016 00:46
便利ツール2、プロジェクト名の変更
#!/bin/bash
renameDirectories () {
for i in `find . -name \*$oldProject\* -type dir`
do
oldFile=$i
newFile=`echo $i | sed -e s/$oldProject/$newProject/g`
echo "mv $oldFile $newFile"
mv $oldFile $newFile
done
@externvoid
externvoid / index.html
Last active January 2, 2018 02:37
同期通信テスト
<!DOCTYPE html>
<!-- https://www.ajaxtower.jp/ini/http/index3.html -->
<!-- 同期通信によるファイルの取得 -->
<html lang="ja">
<head>
<meta http-equiv="Content-Type" Content="text/html;charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
@externvoid
externvoid / actR.rb
Created January 9, 2018 07:55
初めてのActiveRecord
require 'active_record'
require 'pp'
ActiveRecord::Base.establish_connection(
adapter: "sqlite3",
database: "./yatoday.db"
)
class Code < ActiveRecord::Base
self.table_name = "Code2018_01_05"
@externvoid
externvoid / googleChart.html
Last active January 10, 2018 06:19
google chartサンプル
<!-- http://www.itdashboard.go.jp/DataFeeds/sampleGc -->
<!-- jQueryのgetJSONでjsonを取って来て、jsonData変数へ格納 -->
<!-- jsonData.raw_dataは配列でjsonData.raw_data[0], jsonData.raw_data[1]...って -->
<!-- 感じでアクセスできる。 -->
<!-- 入っている要素はjson。 -->
<!-- こいつをgoogle.visualization.DataTable型のdataへ放り込めば良い! --><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sample Google Charts</title>
@externvoid
externvoid / jsLineFeed.js
Created January 10, 2018 04:24
ES6はどこで改行してもOK!(node -v 9.2.0)
const f = (x) => {
return (
x * x
)
}
const g = (x) =>
{
return ( x
* x
)
@externvoid
externvoid / royal300.json
Created February 20, 2018 11:20
英文暗記
[
{
"no": 1,
"point_no": 1,
"japanese": "この池は冬には凍る。",
"english": "This pond freezes in the winter.",
"note": "最も基本的な形。「∼は」にあたる this pond を主語に決めたら,述語動詞の freeze に3単現の -s が必要かどうかを考える。修飾語句の「冬には」は〈in the winter〉として文末に置く。この the はつけなくてもよい。"
},
{
"no": 2,
@externvoid
externvoid / dsl.rb
Last active March 8, 2018 10:31
DSLの作り方
# クラスメソッド Enalbe_foo
module Product
def foo
puts "OK2"
end
end
class F
include Product
end
@externvoid
externvoid / attr_dsl.rb
Created March 8, 2018 10:26
making attr_* method by Ruby code
#内部DSLのソースコード
class Module
def attr_reader(*symbols)
symbols.each do |symbol|
class_eval %(
def #{symbol}
@#{symbol}
end
)
end
@externvoid
externvoid / eigen.rb
Created March 8, 2018 14:17
クラスメソッド、得意メソッドの作り方
# 得意メソッド、クラスメソッド定義2連発、3連発
# class << C, class << a, def self.foo, def a.foo
class C;end
# (1)
class << C
def foo
puts 'OK'
end
end
class C
@externvoid
externvoid / git_command_sammary.md
Last active July 10, 2018 09:08
gitコマンド

ブランチの操作

現在存在するブランチの確認

git branch
* master

新規にブランチ作成

git checkout -b feature-A