Skip to content

Instantly share code, notes, and snippets.

@onocom
onocom / settings.json
Last active May 12, 2018
VS CODE でLive Sass Compilerを利用する場合の設定
View settings.json
{
"liveSassCompile.settings.formats":[
{
"format": "expanded",
"extensionName": ".css",
"savePath": "~/../"
}
],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
@onocom
onocom / sftp.json
Last active May 2, 2018
VisualStudio CodeのSFTPのコンフィグ参考ファイル(CPIサーバー用)
View sftp.json
{
"protocol": "sftp",
"host": "aeXXX.secure.ne.jp",
"username": "aeXXXXXXX_username",
"password": "P@ssW0rd",
"ignore": [".editorconfig"],
"remotePath": "/html",
"port" : 10397
}
@onocom
onocom / config.rb
Last active Feb 2, 2018
Dreamweaverでcompassを動作させようとした時のconfig.rb 詳しくはブログにまとめました http://onocom.net/blog/dreamweaver-sass-compass/
View config.rb
Encoding.default_external = "UTF-8"
http_path = "/"
css_dir = "/wp-content/themes/THEME_NAME/css/"
sass_dir = "/wp-content/themes/THEME_NAME/scss/"
images_dir = "/wp-content/themes/THEME_NAME/images/"
javascripts_dir = "/wp-content/themes/THEME_NAME/js/"
fonts_dir = "/wp-content/themes/THEME_NAME/fonts/"
output_style = :expanded # :expanded or :nested or :compact or :compressed
@onocom
onocom / .htaccess
Created Sep 26, 2017
WordPress security settings .htaccess
View .htaccess
# .htaccessの上の方に追加
# TOPページへのPOSTアクセスを拒否
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{REQUEST_METHOD} ^POST
RewriteRule .* - [F]
</IfModule>
View PHP_backup_zip_command_from_php.php
<?php
$PATH_TARGET = "/PATH/TO/TARGET/";
$PATH_SAVE = "/PATH/TO/SAVE/";
// zip name
$file_name = "backup.zip";
$command = "
cd ". $PATH_TARGET ."
zip -qr ". $PATH_SAVE . $file_name ." . ";
@onocom
onocom / perl-test.cgi
Created Mar 29, 2017
cgi動作確認用サンプルコード
View perl-test.cgi
#!/usr/local/bin/perl
print "Content-type: text/plain\n\n";
print "Hello !\n";
@onocom
onocom / japan-prefecture.html
Created Mar 4, 2017
都道府県を絞り込む処理
View japan-prefecture.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>日本の都道府県一覧</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
jQuery(function ($) {
@onocom
onocom / google-map-link-url-memo.txt
Created Dec 20, 2016
GoogleMapのリンクURLのフォーマット
View google-map-link-url-memo.txt
@onocom
onocom / class-business-calendar.php
Last active Oct 31, 2016
営業日カレンダーを表示するクラス
View class-business-calendar.php
<?php
class business_calendar {
const WEEK = 7; // 1 week is 7 days
// holiday_of_week flag index
const IDX_SUNDAY = 0;
const IDX_MONDAY = 1;
const IDX_TUESDAY = 2;
const IDX_WEDNESDAY = 3;
const IDX_THURSDAY = 4;
@onocom
onocom / CPI-WPCLI-PHP7-batch.sh
Created Jul 11, 2016
CPIのレンタルサーバにWPCLIをインストールする PHP7版
View CPI-WPCLI-PHP7-batch.sh
# http://www.cpi.ad.jp/evangelist/maekawa/column01/001.html
cd ~
mkdir bin
cd bin/
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
cd ~
echo alias wp 'php-7.0 ~/bin/wp-cli.phar' > .cshrc
source .cshrc
wp --info
cd ~/html
You can’t perform that action at this time.