This file contains hidden or 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
sudo update-alternatives --config editor |
This file contains hidden or 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
``` | |
rails g migration AddカラムToテーブル カラム:型 | |
``` | |
AddカラムToテーブルのカラムとテーブルの頭文字は大文字じゃないとダメなので注意 | |
なぜかmasterブランチでやらないとコケる |
This file contains hidden or 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
#!/bin/sh | |
virt-install \ | |
--name ubuntu14-test-template \ | |
--vcpus 2 \ | |
--ram 1024 \ | |
--hvm \ | |
--virt-type kvm \ | |
--os-type=linux \ | |
--os-variant ubuntusaucy \ | |
--network bridge=br0 \ |
This file contains hidden or 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
create procedure hoge() | |
begin | |
declare counter int; | |
declare hogehoge int; | |
set @counter = 1; | |
while @counter < 100 do | |
set @hogehoge = ceil(RAND()*30000); | |
update kadai1 set id=1 where id=@hogehoge; | |
set @counter = @counter +1; | |
select @hogehoge; |
This file contains hidden or 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
``` | |
ffmpeg -i 入力ファイル名.mkv -vcodec copy 出力ファイル名.mp4 | |
``` |
This file contains hidden or 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
#!/bin/sh | |
NAME=vyos | |
qemu-img create -f raw vyos.img 2G | |
virt-install \ | |
--connect qemu:///system \ | |
--name ${NAME} \ | |
--vcpus 1 \ | |
--ram 512 \ | |
--network bridge=br0 \ | |
--file /var/lib/libvirt/images/${NAME}.img \ |
This file contains hidden or 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
internal func ImageResizer(ImgPath: String) -> (CGFloat,CGFloat) { | |
let ImportImage:UIImage? = UIImage(named: ImgPath) | |
var width = ImportImage?.size.width | |
var height = ImportImage?.size.height | |
print(width,height) | |
if Int(myBoundSize.height) == iPhone4s { | |
print("iPhone4s") | |
} else if Int(myBoundSize.height) == iPhone5 { | |
print("iPhone5") |
This file contains hidden or 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 'shared-mime-info' | |
path = 'hoge.xls' | |
p MIME.check_magics(path) #'application/x-ole-storage |
This file contains hidden or 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 'zip_code_jp' | |
post_code = '903-2123' #郵便番号 | |
input_address = '沖縄県なんとか市なんとか町3-121' #住所 | |
address = ZipCodeJp.find post_code | |
string = "#{address.prefecture}#{address.city}#{address.town}" | |
if input_address.include?(string) == true then | |
input_address.slice!(string) | |
p input_address | |
else |
This file contains hidden or 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
hoge = '000-0000-0000' | |
hoge.delete('-') |
OlderNewer