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
escape_html = (string) -> | |
if typeof string != 'string' | |
return string | |
string.replace /[&'`"<>]/g, (match) -> | |
{ | |
'&': '&' | |
'\'': ''' | |
'`': '`' | |
'"': '"' | |
'<': '<' |
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
<?php | |
// 特定のカスタムページテンプレートだけ、管理画面でビジュアルエディタ(リッチエディタ)を非表示 | |
function disable_visual_editor_in_page_template(){ | |
global $typenow; | |
$template_name = basename( get_page_template_slug( $_GET['post'] ), '.php' ); | |
if( $typenow == 'page' and $template_name == 'TEMPLATE_NAME' ){ | |
add_filter('user_can_richedit', create_function('' , 'return false;') ); | |
} | |
} | |
add_action( 'load-post.php', 'disable_visual_editor_in_page_template' ); |
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
<?php | |
$uri = $_SERVER["REQUEST_URI"]; | |
$is_home = $uri == '/' || $uri == '/index.html'; | |
// var_dump($is_home); | |
?> |
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
### | |
# Class.Canvas | |
### | |
class Class.Canvas | |
constructor: (options)-> | |
# Variables | |
@items = [] | |
@fps = 30 | |
@itemIncrement = 0 | |
# Context initialize |
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
### | |
# Class.Canvas | |
### | |
class Class.Canvas | |
constructor: (options)-> | |
# Variables | |
@items = [] | |
@fps = 30 | |
# Context initialize | |
until options? then return false |
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
// デバッグ用 | |
@mixin area | |
background: rgba(255,0,0,0.5) | |
// 座標指定 | |
@mixin pos($top,$left) | |
position:absolute | |
top: #{$top}px | |
left: #{$left}px | |
@mixin pos_tl($top,$left) | |
position:absolute |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="format-detection" content="telephone=no"> | |
<meta name="viewport" content="width=device-width"> | |
<meta name="description" content=""> | |
<meta name="keywords" content=""> | |
<title></title> | |
<!-- styles --> |
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
mainLoop = | |
initialize: -> | |
@currentTime = @getTime | |
@lastTime = @currentTime | |
vendors = ["ms", "moz", "webkit", "o"] | |
x = 0 | |
while x < vendors.length and not window.requestAnimationFrame | |
window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"] |