Skip to content

Instantly share code, notes, and snippets.

@Nully
Nully / ramen.js
Last active August 29, 2015 13:58
ラーメンjs
/**
* 仕様
* 食べることができる
* 注文することができる
* 替え玉することができる
* トッピングができる
  * トッピングは複数種類存在する
* スープを飲むことができる
* プラグインはどんな形式でも問わない
*/
@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 / gist:713140
Created November 24, 2010 04:58
PeaerPackageInstaller
#!/usr/bin/env ruby
`pear remote-list`.each_line do |p|
puts p.split(/\s+/)[0]
`pear install -f #{p.split(/\s+/)[0]}`
end
@Nully
Nully / gist:719692
Created November 29, 2010 07:30
URLValidator
<?php
class Nully_Validate_Uri extends Zend_Validate_Abstract {
const INVALID_URI = "%value% is invalid URI";
/**
* Checking for http including URI pattern.
*
* @uses Zend_Uri
* Zend_Uri::check method is checking URI scheme including pattern.
*/
@Nully
Nully / Maintenance.php
Created May 27, 2011 16:09
Zend_Application_Resouce_Maintenance
<?php
/**
* Zend Framework - メンテナンスモードプラグイン
*/
require_once "Zend/Controller/Plugin/Abstract.php";
class Zend_Controller_Plugin_Maintenance
extends Zend_Controller_Plugin_Abstract
{
@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'.
@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 / 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 / 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 / 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;