cmd.exe を管理者モードで起動して
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
を実行
| ・mkdir /usr/local/sbin | |
| ・.bash_profileに | |
| PATH=/usr/local/sbin/:$PATH | |
| を設定しておく | |
| ・Cocoa Emacsを使う | |
| $ brew uninstall autoconf |
| for (( i=0 ;i<40; i++ )) | |
| do | |
| raspivid -t 0 -n -o test.h264 | |
| done |
cmd.exe を管理者モードで起動して
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
を実行
| ``` | |
| # クオートで囲った文字列 クオートの中で「\'」を使うことで「'」表現することができる。「\\」を使うことで「\」を表現することができる。 | |
| QuoteString = "'" QuoteStringElement+:cc "'" { cc.join } | |
| QuoteStringElement = ( QuoteStringSingleQuote | |
| | QuoteStringBackslash | |
| | QuoteStringOtherchar | |
| ) | |
| QuoteStringSingleQuote = "\\'" { "'" } | |
| QuoteStringBackslash = "\\\\" { "\\" } | |
| QuoteStringOtherchar = < /[^']/ > { text } |
| ``` | |
| # ダブルクオートで囲った文字列 | |
| # バックスラッシュ記法できる文字 | |
| # 「\"」 ダブルクオート | |
| # 「\n」 改行 | |
| # 「\r」 キャリッジリターン | |
| # 「\t」 タブ | |
| # 「\v」 垂直タブ | |
| # 「\f」 改ページ | |
| # 「\b」 バックスペース |
| #!/bin/sh | |
| # コマンドでエラーが返ってきた時点で停止 | |
| set -e | |
| # 1つめの引数に-が含まれている場合 ${variable#pattern}で、variableの値の最初の部分とpatternが一致した場合に、最も短く一致した部分を削除して、残りを返す。 | |
| if [ "${1#-}" != "$1" ]; then | |
| # set -- a b は、 --の後のパラメータを$1,$2,...に格納し直す | |
| # "$@"は、$1 $2 $3 ... を "$1" "$2" "$3" という感じの形式に変換する | |
| set -- php "$@" |
| ``` | |
| $handler = fopen($file, 'w+'); | |
| $encoding = 'SJIS'; | |
| $attributeCodes = array('price','name'); | |
| $collection = Mage::getResourceModel('catalog/product_collection'); | |
| // * はjoinしないので使えない $collection->addAttributeToSelect('*'); | |
| foreach ($attributeCodes as $attributeCode) { | |
| // $collection->addAttributeToSelect($attributeCodes, 'left'); は1.9では使えない | |
| $collection->addAttributeToSelect($attributeCode, 'left'); // leftにしないと属性が無い場合に取得できない | |
| } |
| #!/usr/bin/env bash | |
| # 既にタグが存在していればそのURLを抽出 | |
| UPLOAD_URL=`curl -s -H "Authorization: token $GITHUB_ACCESS_TOKEN" https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases|jq "map(select(.tag_name == \"v$CIRCLE_BUILD_NUM\")) | .[].upload_url" | sed -e 's/{?name,label}/?name=/g' | sed -e 's/"//g'` | |
| # タグが存在していなければ、新規タグを作成する | |
| if [ -z ${UPLOAD_URL} ]; then | |
| API_JSON=$(printf '{"tag_name": "v%s","target_commitish": "master","%s": "v%s","body": "Release of version %s","draft": true,"prerelease": false}' $CIRCLE_BUILD_NUM $CIRCLE_BRANCH $CIRCLE_BUILD_NUM $CIRCLE_BUILD_NUM) | |
| echo $API_JSON | |
| UPLOAD_URL=`curl -s -H "Authorization: token $GITHUB_ACCESS_TOKEN" --data "$API_JSON" https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases | jq '.upload_url' | sed -e 's/{?name,label}/?name=/g' | sed -e 's/"//g'` | |
| fi |