Skip to content

Instantly share code, notes, and snippets.

import js.Lib;
class Main{
static function main(){
js.Lib.alert('hoge');
}
}
@yokotak0527
yokotak0527 / gist:5924800
Created July 4, 2013 03:52
JSで気になる書き方
var obj = {};
(obj.Func = function(){}).prototype = {};
@yokotak0527
yokotak0527 / gist:5235458
Created March 25, 2013 07:29
IE6で画像リサイズ
img{
max-width:250px;
width: expression(this.width >= this.height ? '250px' : 'auto');
}
@yokotak0527
yokotak0527 / gist:5211058
Created March 21, 2013 06:23
WordPressのエディターを強制的にHTMLモードにする
add_action('admin_head','page_editor');
function page_editor(){
global $post_type;
global $user_ID;
// 固定ページの場合HTMLエディターに
if($post_type == 'page'){
add_filter('user_can_richedit','__return_false');
}
};
@yokotak0527
yokotak0527 / gist:5193203
Created March 19, 2013 02:18
macからNASへのアクセスが多い場合 参考 -> http://ymkn.hatenablog.com/entry/2012/09/24/002517
/etc/sysctl.confに
net.inet.tcp.delayed_ack=0
@yokotak0527
yokotak0527 / gist:5166676
Last active December 14, 2015 23:38
orig_concat動かす為にexecを使うのはなんか違う気がする。後で調べる
'use strict';
module.exports = function(grunt){
var config = grunt.config,
exec = require('child_process').exec,
say = 'say -v kyoko ';
var jsDir = 'sample/build/'; // jsのディレクトリ
var jsDestDir = 'sample/';
@yokotak0527
yokotak0527 / gist:5151272
Created March 13, 2013 11:32
ゆっくり喋らせる
'use strict';
// =============================================================================
// 変更点
// =============================================================================
// '<config:prop.subprop>' → '<%= prop.subprop %>'
// '<json:file.json>' → grunt.file.readJSON('file.json')
// '<file_template:file.js>' → grunt.template.process(grunt.file.read('file.js'))
module.exports = function(grunt){
// =============================================================================
// 参照:https://npmjs.org/doc/json.html
// =============================================================================
{
// -------------------------------------------------------------------------
// name : プロジェクト名 [必須]
// -------------------------------------------------------------------------
"name":"v0.4",
// -------------------------------------------------------------------------
@yokotak0527
yokotak0527 / gist:4759796
Created February 12, 2013 02:39
WordPress ページング
function paging($query_arr){
global $total_page_num;
global $paged;
$range = 5;
$half = 0;
$range_offset = 0;
$page_offset = 0;
$cnt = '<nav class="paging"><ul>';
// prev
if($paged != 1){
@yokotak0527
yokotak0527 / gist:4719739
Last active December 12, 2015 05:08
WordPressで投稿をカスタム投稿に移動させるときのテンプレ
<?php
// WordPress post moves to custom post.
// 参考 -> http://techblog.55w.jp/?p=224
$posts = get_posts(array(
'post_type'=>'post',
'numberposts'=>500
));
// カテゴリーからカスタムタクソノミーに移動させるときに利用
// keyがカテゴリー名でvalがターム名
// key is category name,val is term name.