コマンド | 説明 | 使い方 | 備考 |
---|---|---|---|
pwd | カレントディレクトリの絶対パスを表示する | pwd | print working directoryの略 |
ls | カレントディレクトリ内に存在するファイルを一覧表示する | ls <ディレクトリ名> | ディレクトリ名を指定しなかった場合はカレントディレクトリを指定したとみなされる |
cd | 指定したディレクトリに移動する | cd <ディレクトリ名> | ディレクトリ名を指定しなかった場合はホームディレクトリを指定したとみなされる |
mkdir | ディレクトリを作る | mkdir <ディレクトリ名> | make directory の略 |
rm | ファイルを削除する | rm <ファイル名> | remove の略。ディレクトリを削除したい場合は -r オプションが必要 |
mv | ファイルを移動させる | mv <移動元> <移動先> | 移動元と移動先が同じディレクトリにある場合は、実質ファイル名の変更として使える |
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
/* Checking macros for stdio functions. | |
Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. | |
This file is part of GCC. | |
GCC is free software; you can redistribute it and/or modify it under | |
the terms of the GNU General Public License as published by the Free | |
Software Foundation; either version 3, or (at your option) any later | |
version. |
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
/********************************************************************** | |
* CSS生成日 : 2021/05/10 18:42:06 | |
* バージョン: Chat v2.0 Style Generator 日本語版 2021.03.27 | |
**********************************************************************/ | |
/* Background colors - 背景色 */ | |
body { | |
overflow: hidden; |
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
work="./work" | |
object=$1 | |
mkdir $object | |
for i in $(ls $work) | |
do | |
mv $work/$i/* $object/$object\_$i.png | |
done |
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
package main | |
import( | |
"fmt" | |
) | |
type Hoge struct { | |
A int | |
B struct { | |
X int |
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
#include<algorithm> | |
#include<iostream> | |
template<typename T> | |
class RingBuffer{ | |
T *array; | |
size_t sum; | |
int zero; | |
bool rev; | |
int Index(const int index) const; | |
void Init(); |
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
package main | |
import ( | |
"database/sql" | |
_ "github.com/go-sql-driver/mysql" | |
) | |
func main() { | |
db, _ := sql.Open("mysql", "user:password@tcp(host:port)/dbname") | |
tx, _ := db.Begin() // トランザクション開始 |
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
func main(){ | |
db, _ := sql.Open("mysql", "user:password@tcp(host:port)/dbname") | |
tx, _ := db.Begin() | |
defer func() { | |
// panicが起きたらロールバック | |
if recover() != nil { | |
tx.Rollback() | |
} | |
}() | |
} |
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
tx, _ := db.Begin() // トランザクション開始 | |
stmt, _ := tx.Prepare("INSERT INTO hoge (id) VALUES (?)") | |
stmt.Exec("0000") | |
tx.Commit() |
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
stmt1, _ := db.Prepare("INSERT INTO hoge (id) VALUES (?)") | |
tx, err := db.Begin() // トランザクション開始 | |
stmt2 := tx.Stmt(stmt1) | |
stmt1.Exec("0000") // トランザクションに含まれない | |
stmt2.Exec("0000") // トランザクションに含まれる | |
tx.Commit() |
NewerOlder