CoffeeScriptはJavaScriptをRuby・Pythonに似たシンタックスで書けるようにする言語です。
- 開発者: Jeremy Ashkenas
- 公式ページ: http://coffeescript.org/
- レポジトリ: https://github.com/jashkenas/coffee-script
文法・JavaScriptへの変換は公式ページから試せます。
function array_transpose($array_of_array) { | |
$column_keys = array(); | |
foreach ($array_of_array as $row_key => $array) { | |
$column_keys = array_merge($column_keys, array_keys($array)); | |
} $column_keys = array_unique($column_keys); | |
$transposed_array = array(); | |
foreach ($column_keys as $column_key) { | |
$transposed_array[$column_key] = array(); | |
foreach ($array_of_array as $row_key => $array) { |
#!/bin/bash | |
DIRS=( | |
$(git rev-parse --show-toplevel)/navona/MailInspector/mi/lib | |
$(git rev-parse --show-toplevel)/navona/MailInspector/mi/resources | |
$(git rev-parse --show-toplevel)/navona/MailInspector/mi/mi | |
$(git rev-parse --show-toplevel)/navona/MailInspector/mi/sys/agent | |
) | |
pcregrep -r -M ',\s*}' ${DIRS[@]} | |
if [ $? -ne 1 ]; then |
CoffeeScriptはJavaScriptをRuby・Pythonに似たシンタックスで書けるようにする言語です。
文法・JavaScriptへの変換は公式ページから試せます。
#!/bin/sh | |
pep8 `git rev-parse --show-toplevel` |
#!/bin/bash | |
echo 'dummy fail!' | |
exit 1 |
# for Debian | |
# sudo aptitude install mercurial gettext libncurses5-dev | |
# for CentOS | |
# sudo yum install gettext ncurses-devel -y | |
# # mercurial | |
# sudo yum install gcc python python-devel python-setuptools -y | |
# sudo easy_install mercurial | |
cd /tmp | |
wget --no-check-certificate https://github.com/git/git/archive/master.tar.gz | |
tar xvf master.tar.gz | |
# for CentOS | |
# sudo yum install -y gcc zlib zlib-devel curl curl-devel expat expat-devel gettext openssl-devel | |
# for Debian | |
# sudo aptitude install build-essential zlib1g zlib1g-dev curl libcurl4-openssl-dev libexpat1 libexpat1-dev gettext |
#!/bin/bash | |
echo "dummy!" |
#!/usr/bin/python3 | |
# コミット時にNGワードが含まれていないかチェックする | |
import sys | |
import re | |
import os.path | |
import io | |
import itertools | |
from subprocess import check_output | |
from fnmatch import fnmatch |
#!/bin/bash | |
p1='\.(php|inc|view|edit|check|wui|mod|cnf|hlp|)$' | |
p2='resource/.*/locale/' | |
root=$(git rev-parse --show-toplevel) | |
files=($(git diff --name-only --cached | egrep "$p1|$p2" | sed -e "s|^|$root/|")) | |
failed=0 | |
for f in "${files[@]}"; do | |
php -l "$f" > /dev/null || failed=1 | |
done |