Skip to content

Instantly share code, notes, and snippets.

kawabataryo kawabataryo

Block or report user

Report or block kawabataryo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .babelrc
{
"presets": ["es2015"]
}
View bower.json
{
"name": "dev_setting",
"private": true,
"dependencies": {
"bootstrap": "3.3.6",
"jquery": "2.2.0",
"jquery-validation": "1.14.0",
"jquery-validation-unobtrusive": "3.2.5",
"knockout": "3.4.0",
"linqjs": "3.0.5",
View spResize.js
function spResize(){
$(window).on("resize", function(){
$("html").css("zoom" , $(window).width()/320 );
}).trigger("resize");
}
@kawabataryo
kawabataryo / 01mail.php
Last active Sep 3, 2015
mailform sample
View 01mail.php
<?php
ini_set('display_errors', 0);
session_start();
//トークンを生成
$token = sha1(uniqid(mt_rand(), true));
$_SESSION['token'] = $token;
//エスケープ
View get_form_str_length.js
/**
* [namespace]
*/
var App = App || {};
/**
* [Model]
*/
App.Model = function(text){
this.text = text;
View error.js
function TextCount(){
this.textArea = document.getElementById('textArea');
this.textCount = document.getElementById('textCount');
this.init();
}
TextCount.prototype = {
init: function(){
var that = this;
@kawabataryo
kawabataryo / OpenGraph.html
Last active Aug 29, 2015
facebook Open Graph
View OpenGraph.html
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja" dir="ltr" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<meta property="og:title" content="記事のタイトル" />
<meta property="og:type" content="article" /> <!-- トップページはwebsite、個別ページはarticle -->
<meta property="og:description" content="記事の説明" />
<meta property="og:url" content="記事のURL" />
<meta property="og:image" content="画像のURL" />
<meta property="og:site_name" content="サイトのタイトル" />
<meta property="og:locale" content="言語" />
<meta property="fb:admins" content="facebookのユーザーID" />
@kawabataryo
kawabataryo / hasElement.js
Last active Aug 29, 2015
ページ内に指定した要素があるか判定する
View hasElement.js
/**
* @param {String} selector 判定する要素
* @return {Boolean}
*/
function hasElement(selector){
var el = document.querySelector(selector);
if(el !== null){
return true;
}
return false;
@kawabataryo
kawabataryo / jquery.showElementOnScroll.js
Last active Aug 29, 2015
特定の位置で対象を表示する
View jquery.showElementOnScroll.js
/**
* 特定の位置で対象を表示する
* @param {String} el 対象のセレクター ※必須
* @param {Number} position 特定の位置 ※必須
*/
function ShowElementOnScroll(el,position){
this.$el = $(el);
this.position = position;
this.$window = $(window);
this.event();
@kawabataryo
kawabataryo / inherits.js
Created Nov 8, 2014
クラス継承に関するメモ
View inherits.js
//inherits
function inherits(ctor, superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
You can’t perform that action at this time.