apm install platformio-ide-terminal
apm install japanese-menu
apm install file-icons
apm install markdown-preview-plus
apm install file-types
apm install minimap
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
# System Integrity Protection 解除 | |
事前にリカバリモードでSystem Integrity Protectionを解除 | |
``` | |
csrutil disable | |
``` | |
作業がおわったら | |
``` | |
csrutil enable | |
``` |
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
jq '(.blocks[] | select(.t == "Table") .c[2]) |= [0,0,0]' |
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
$parent->getProduct()->setIsSuperMode(true); |
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
$attribute_code = ''; | |
$value = ''; | |
$attribute = Mage::getSingleton('eav/config')->getAttribute(Mage_Catalog_Model_Product::ENTITY, $attribute_code); | |
if (in_array($attribute->getFrontendInput(), array('select')) && strlen($value) > 0) { | |
$values = Mage::getResourceModel('eav/entity_attribute_option_collection')->setAttributeFilter( | |
$attribute->getId()) | |
->setStoreFilter() | |
->addFieldToFilter('tdv.value', array('in' => $value)) | |
->load(); |
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/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 |
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
``` | |
$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にしないと属性が無い場合に取得できない | |
} |
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/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 "$@" |
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
``` | |
# ダブルクオートで囲った文字列 | |
# バックスラッシュ記法できる文字 | |
# 「\"」 ダブルクオート | |
# 「\n」 改行 | |
# 「\r」 キャリッジリターン | |
# 「\t」 タブ | |
# 「\v」 垂直タブ | |
# 「\f」 改ページ | |
# 「\b」 バックスペース |
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
``` | |
# クオートで囲った文字列 クオートの中で「\'」を使うことで「'」表現することができる。「\\」を使うことで「\」を表現することができる。 | |
QuoteString = "'" QuoteStringElement+:cc "'" { cc.join } | |
QuoteStringElement = ( QuoteStringSingleQuote | |
| QuoteStringBackslash | |
| QuoteStringOtherchar | |
) | |
QuoteStringSingleQuote = "\\'" { "'" } | |
QuoteStringBackslash = "\\\\" { "\\" } | |
QuoteStringOtherchar = < /[^']/ > { text } |
NewerOlder