- なにかを書いてみる
- react/docs/docs at master · facebook/reactを読む
- propsとstateについて学ぶ
- というよりもstateless componentで書いてみる
- そうするとstateがドンドン上に上がっていく
JavaScript を使っていると「JavaScript出来るの? jQuery / AngularJS / Node.js etc... で困ってるんだけどさー」みたいな話を振られることがあります。 そういった時に、自分は一般的なライブラリの使い方やフレームワークに対して大した知見も興味もないので、わざわざ説明するのも面倒なのでこうして文章にしておきます。(本当に届いて欲しい人に限って、こういう文章が届かないのはわかっていますが、文章を書くこと自体が気晴らしだと思って諦めます。)
先ほどのような話は自分に限ったことではなく、たぶん経験のある人も多いでしょう。 振られた話が自分の分かる範囲、あるいは興味のあるものならばまだ良いのですが、そうでないことがあまりに多すぎます。 話を振られるだけならともかく「JavaScriptできるんでしょ? じゃあ jQuery つかったこのサービスのメンテしてほしいんだけどー」みたいに仕事として振られることもあり、そう言う時は脳みそ取り出して洗剤で洗った方が良いのでは、と思うことも多々あります。
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
#!/bin/bash | |
# Get current swap usage for all running processes | |
# Erik Ljungstrom 27/05/2011 | |
# Updated: 2013-11-13 Yuichiro Saito | |
SUM=0 | |
OVERALL=0 | |
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do | |
PID=`echo $DIR | cut -d / -f 3` | |
PROGNAME=`ps -p $PID -o comm --no-headers` | |
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'` |
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
# 私が考える安全なプログラムを書くために必要なこと | |
今も昔も「入力によって挙動が大幅に変わるAPI」が世の中には多数存在していて、プログラマが本来意図した挙動と異なる動作を引き起こしている。 | |
- ファイルを開こうとしたらコマンドを実行できてしまったり | |
- CSSセレクタを書いてるつもりがHTMLタグを生成してしまったり | |
- SELECT文を発行するつもりがDELETE文を発行できてしまったり | |
こういったときに | |
- 入力値検証をしないと危険になる |
- Fork from Docker cheat sheet
- 実際にコマンドを試したい場合は、すぐにDockerを試したい人のための基礎コマンドを参照
Why Should I Care (For Developers)
"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."
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
#!perl | |
use strict; | |
use warnings; | |
use Furl; | |
use Imager; | |
use Text::AAlib qw(:all); | |
my $url = 'https://1.gravatar.com/avatar/ca6281fff64797dc419b78f51f25c0a5?d=https%3A%2F%2Fidenticons.github.com%2F51beaebc231c8720d18d10b0008693dc.png&s=420'; | |
my $ua = Furl->new; |
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
#!/usr/local/bin/ruby | |
require 'json' | |
result = {} | |
cur_ks = nil | |
cur_cf = nil | |
ARGF.each_line do |line| | |
line.strip! | |
if line =~ /^Keyspace: (.+)/ |
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
#!/bin/bash | |
### 使い方 | |
### アラート停止:nagios_alert.sh stop web01 db01 | |
### アラート再開:nagios_alert.sh start web01 db01 | |
command_file="/var/spool/nagios/cmd/nagios.cmd" | |
if [ $# -lt 2 ];then | |
echo "usage: $0 <start|stop> hosts1 host2 ..." |
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
# Install pyenv in ~/.pyenv | |
cd ~ | |
git clone git://github.com/yyuu/pyenv.git .pyenv | |
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.zshrc | |
echo 'if [ -d "${PYENV_ROOT}" ]; then' >> ~/.zshrc | |
echo ' export PATH=${PYENV_ROOT}/bin:$PATH' >> ~/.zshrc | |
echo ' eval "$(pyenv init -)"' >> ~/.zshrc | |
echo 'fi' >> ~/.zshrc |
NewerOlder