Skip to content

Instantly share code, notes, and snippets.

// definition
Array.dim = function(dimention, initial) {
var a = [], i;
for (i = 0; i< dimention; i += 1) {
a[i] = initial;
}
return a;
}
// console.log(Array.dim(10, 2));
/*
* WordPressの投稿作成画面で必須項目を作る(空欄ならJavaScriptのアラート)
*/
add_action( 'admin_head-post-new.php', 'mytheme_post_edit_required' ); // 新規投稿画面でフック
add_action( 'admin_head-post.php', 'mytheme_post_edit_required' ); // 投稿編集画面でフック
function mytheme_post_edit_required() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
if( 'post' == $('#post_type').val() || 'page' == $('#post_type').val() ){ // post_type 判定。例は投稿と固定ページ。カスタム投稿タイプは適宜追加
<?php
/**
* <a href="mailto:xxx"> の mailto:xxx 部分を作成する
* ファイルの文字コードはUTF-8
*/
function createMailLink($to_address, $subject = null, $body = null)
{
$mail_html = "";
$str_encode = 'UTF-8';

追記

この記事は古いです...。はてなブログの方に完全版を置いてあります。→ http://blue-ham-cake1024.hatenablog.com/entry/2012/09/07/Sublime_Text_2_のDefault設定ファイルを眺める


はてなブログは調子が悪いようなので。

この記事ではDefault設定ファイルにどのような記述がされているか、その記述にどんな意味があるかを一つ一つ見ていきます。実際に設定をカスタマイズしてみたい方は、メニューのPreferencesタブの"Settings - User"からUser設定ファイルを開いてそこでいろいろ試してみましょう。

$.ajax({
url: "ajax.html",
success: function(data) {
alert('success!!');
},
error: function(data) {
alert('error!!!');
}
});
// ===================================
// Example
// ===================================
/**
* Point
* @class
* @augments Class
* @param {Number} x x-axis
* @param {Number} y y-axis
*/
{
/*
* UI関係
*/
// カラー&スキーマ
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", // カラー
"theme": "Soda Dark.sublime-theme", // スキーマ
// カーソルのスタイル ("smooth", "phase", "blink", "wide", "solid")
"caret_style": "smooth",
CREATE TABLE test (
day1 DATETIME,
day2 TIMESTAMP
);
SET SESSION time_zone = 'UTC';
INSERT INTO test VALUES ('2014-12-25 00:00:00', '2014-12-25 00:00:00');
SET SESSION time_zone = 'Asia/Tokyo';
INSERT INTO test VALUES ('2014-12-25 00:00:00', '2014-12-25 00:00:00');
SET SESSION time_zone = 'UTC';
SELECT * FROM test;
@webgyo
webgyo / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@webgyo
webgyo / gulpfile.js
Last active August 29, 2015 14:11 — forked from gaspanik/gulpfile.js
// Original: https://github.com/gaspanik/gulpbase/
var gulp = require('gulp'),
// 列挙するのが面倒なので、load-pluginsでプラグインをロード。何使ってるかは「package.json」で
$ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*'],
replaceString: /\bgulp[\-.]/
}),