Skip to content

Instantly share code, notes, and snippets.

View morygonzalez's full-sized avatar
🌴
I may be slow to respond.

Hitoshi Nakashima morygonzalez

🌴
I may be slow to respond.
View GitHub Profile
@gnachman
gnachman / iterm.scpt
Last active April 27, 2018 05:44
Fix docker quickstart terminal for iTerm2 version 2.9 and later
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"golang.org/x/net/html"
@voluntas
voluntas / eval.rst
Last active April 8, 2024 03:13
評価制度の無い評価制度
@monochromegane
monochromegane / 速習Go.md
Created July 4, 2014 09:16
速習Go。Fukuoka.go#1用の資料です。

速習Go

Go環境のつくりかた

MacOSX

homebrewでインストール

$ brew update
@ravelll
ravelll / peco-select-rake-task.zsh
Created July 2, 2014 04:42
Zsh script to show and select rake tasks using peco.
function peco_select_rake_task_all() {
local tasks="bundle exec rake -AT"
task=$(eval $tasks | peco --query "$LBUFFER" )
task_split=("${(s/ /)task}")
BUFFER=$task_split[1,2]
CURSOR=$#BUFFER
zle -R -c
}
zle -N peco_select_rake_task_all
# 私が考える安全なプログラムを書くために必要なこと
今も昔も「入力によって挙動が大幅に変わるAPI」が世の中には多数存在していて、プログラマが本来意図した挙動と異なる動作を引き起こしている。
- ファイルを開こうとしたらコマンドを実行できてしまったり
- CSSセレクタを書いてるつもりがHTMLタグを生成してしまったり
- SELECT文を発行するつもりがDELETE文を発行できてしまったり
こういったときに
- 入力値検証をしないと危険になる
" vim-automatic
let g:automatic_config = [
\ {
\ "match" : {
\ "filetype" : "help",
\ "buftype" : "help",
\ },
\ "set" : {
\ "height" : "50%",
\ "move" : "bottom",
@kitak
kitak / doc.md
Last active October 18, 2023 09:57
コマンドによる「負荷」の原因切り分け

コマンドによる「負荷」の原因切り分け

この文章では、Linuxコマンド、sar, top, psを使って、一般的に負荷といわれるものの原因を切り分けることを目的とする。

そもそも負荷とは

「複数のタスクによるサーバリソースの奪い合いの結果に生じる待ち時間」を一言で表した言葉。OSのチューニングとは負荷の原因を知り、それを取り除くことにほかならない。

ボトルネックの見極め作業の大まかな流れ

  • ロードアベレージ(処理を実行したくても、実行できなくて待たされているプロセス(CPUの実行権限が与えられるのを待っている、またはディスクI/Oが完了するのを待っている)の数)を見る
@linyows
linyows / generate_hosts.rb
Last active December 17, 2015 13:38
Generate the Hosts Dynamically on AWS
#!/usr/bin/env ruby
# README
#
# Generate the Hosts Dynamically
# ==============================
#
# Usage
# -----
#