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
;; -*- Mode: Emacs-Lisp ; Coding: utf-8 -*- | |
(when load-file-name | |
(setq user-emacs-directory (file-name-directory load-file-name))) | |
(setq ring-bell-function 'ignore) | |
(defvar oldemacs-p (<= emacs-major-version 22)) | |
(when oldemacs-p | |
(defvar user-emacs-directory |
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
# prefix | |
set -g prefix C-z | |
bind C-z send-prefix | |
unbind C-b | |
# config reload | |
bind r source-file ~/.tmux.conf \; display "reloaded" | |
# japanese | |
# setw -g utf8 on |
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
// Dump | |
// 対象テーブルのレコードを全県取得する | |
// すべてのカラムのデータを文字列として扱う | |
func Dump(db *gorm.DB, tableName string) ([]map[string]sql.NullString, error) { | |
var rows, errRows = db.Raw(fmt.Sprintf("SELECT * FROM %s ", tableName)).Rows() | |
if errRows != nil { | |
return nil, errRows | |
} |
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 ChunkingSlice(list interface{}, size int) []interface{} { | |
if size <= 0 { | |
return []interface{}{} | |
} | |
// sliceかどうかのチェック | |
if reflect.TypeOf(list).Kind() != reflect.Slice { | |
return []interface{}{} | |
} |
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
// see https://qiita.com/weloan/items/56f1c7792088b5ede136 | |
package main | |
import ( | |
"fmt" | |
) | |
type Server struct { | |
timeout 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
-- Q0 | |
(defun* q0 (a &optional (acc "")) | |
(if (string= a "") | |
acc | |
(q0 (subseq a 0 -1) (concat acc (subseq a -1))) | |
) | |
) | |
-- Q1 |
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
<?php | |
require_once __DIR__.'/../models.php'; | |
abstract class CardMapper { | |
protected $pdo; | |
public function __construct($pdo) { | |
$this->pdo = $pdo; |
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
<?php | |
abstract class CardMapper { | |
protected $pdo; | |
public function __construct($pdo) { | |
$this->pdo = $pdo; | |
} |
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
<?php | |
abstract class CardMapper { | |
protected $pdo; | |
public function __construct($pdo) { | |
$this->pdo = $pdo; | |
} |
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
defmodule Hello do | |
def world do | |
IO.puts "Hello world from function" | |
end | |
end | |
Hello.world | |
IO.puts "Hello world from inline" |