Skip to content

Instantly share code, notes, and snippets.

@Nully
Nully / jquery.mbua.js
Last active August 29, 2015 14:01
UAからモバイル判別
(function($){
var $window = $(window),
ua = navigator.userAgent.toLowerCase();
$.mbua = $.mbUa = $.mbUA = {
/**
* Android端末でモバイル扱いしたい端末のUAの文字列の一部を格納する
* この配列に入っている端末(UAの文字列)はメソッドから追加することができる
*
* @access protected
@Nully
Nully / jquery.sample.js
Last active May 2, 2020 01:06
jQueryサンプル集
/*
jQueryは今やWeb制作に欠かせないツール・ライブラリとなりました。
そのため、利用頻度も高くなり、HTMLコーダーもJSの記述もできなければなりません。
でも、JavaScriptってなんだか難しそう?と感じる方も多いはず。
そこでjQueryのサンプルをコメントと共に学んでみませんか?
というのがこのコードの目的です。
@Nully
Nully / ramen.js
Last active August 29, 2015 13:58
ラーメンjs
/**
* 仕様
* 食べることができる
* 注文することができる
* 替え玉することができる
* トッピングができる
  * トッピングは複数種類存在する
* スープを飲むことができる
* プラグインはどんな形式でも問わない
*/
@Nully
Nully / example-zf2-global-event-manaer.php
Created July 3, 2012 07:47
ZF2のGlobalEventManagerの使い方例
<?php
namespace App;
use \Zend\EventManager\GlobalEventManager as GEM;
class IndexController extends ActionController
{
function indexAction()
{
// イベントを登録する
@Nully
Nully / example-zf2-shared-event-manager.php
Created July 3, 2012 07:38
ZF2のGlobalEventManagerの使い方例
<?php
namespace App;
use \Zend\ModuleManager\ModuleManager,
\Zend\Mvc\MvcEvent;
class Module
{
protected $config;
@Nully
Nully / weather-onx.js
Created June 8, 2012 04:47
天気予報Rule
// 以下設定 ===================================================================================
// 開始時刻と終了時刻(hh:mmからhh:mmの間)
var times = {
start: { h: '14', m: '00' },
end: { h: '16', m: '00' }
},
// 通知時刻のインターバル(1時間単位)
interval = 1,
@Nully
Nully / gist:1726647
Created February 3, 2012 00:10
いもむし右にいくよ!
setInterval(function(){
var imo = $("#imomushi");
imo.animate({
width: imo.width() + 10,
right: imo.width()
}, function(){
imo.animate({
width: imo.width() - 10,
left: parseInt(imo.css("left").replace("px")) - 10
})
@Nully
Nully / jquery.query-parameter.js
Last active February 20, 2018 05:58
URLの?以降(GET値)を取得する
// jQuery版に書き換えた
(function($){
var queries = (function(){
var s = location.search.replace("?", ""),
query = {},
queries = search.split("&"),
i = 0;
if(!s) return null;
@Nully
Nully / espresso_installer.sh
Created August 4, 2011 03:35
Espresso Installer
#!/bin/bash
# Install start message
func_startMsg()
{
echo ""
echo "Install start $1."
}
func_endMsg()
@Nully
Nully / comments.php
Created June 11, 2011 02:16
WordPressの便利なcomment_formオーバーラップ関数
// comments.php の comment_form 部分を以下に置き換える
<?php
convenience_comment_form(array(
"required" => '<em class="required">*</em>',
// %1$s は required で指定した内容に置き換わる
"required_notes" => '%1$sは必須項目です。',
"fields" => array(
"author" => '<p class="comment-form-author"><label for="hogehoge">お名前</label>%1$s'.
'<input id="hogehoge" type="text" name="author" value="%2$s"%3$s /></p>',
"email" => '<p class="comment-form-email"><label for="email">メールアドレス</label>%1$s'.