Skip to content

Instantly share code, notes, and snippets.

View fetus-hina's full-sized avatar
💭
I may be slow to respond.

AIZAWA Hina fetus-hina

💭
I may be slow to respond.
View GitHub Profile
@fetus-hina
fetus-hina / _chomado_bot.md
Last active August 29, 2015 14:14
ちょまどっぽいど
@fetus-hina
fetus-hina / jquery.reveach.js
Created December 10, 2014 07:55
$('.hoge').each() の逆順
(function($){
"use strict";
$.fn.revEach = function(callback, args) {
var $this = $(this.get().reverse());
$.each($this, callback, args);
};
})(jQuery);
@fetus-hina
fetus-hina / gist:3941974886668df89e7c
Last active August 29, 2015 14:04
OL7 php install
# yum install php
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-21.el7 will be installed
--> Processing Dependency: php-cli(x86-64) = 5.4.16-21.el7 for package: php-5.4.16-21.el7.x86_64
--> Processing Dependency: httpd-mmn = 20120211-x86-64 for package: php-5.4.16-21.el7.x86_64
--> Processing Dependency: php-common(x86-64) = 5.4.16-21.el7 for package: php-5.4.16-21.el7.x86_64
--> Running transaction check
---> Package php.x86_64 0:5.4.16-21.el7 will be installed
@fetus-hina
fetus-hina / ks.cfg
Created July 12, 2014 11:38
さくらVPSにCentOS 7をISO+kickstartでインストールしたのでメモ
install
cdrom
text
unsupported_hardware
lang en_US --addsupport=ja_JP
keyboard jp106
skipx
selinux --disabled
firewall --enabled --ssh
firstboot --disabled
@fetus-hina
fetus-hina / mysqldump_order.php
Created May 21, 2014 14:03
mysqldumpで外部キーの依存がなんとかなるようにdump順を並び替えるための殴り書きスクリプト。並び替え部分がかなりひどい。
<?php
$host = 'localhost';
$port = 3306;
$user = 'DBUSER';
$pass = 'DBPASS';
$database = 'DBNAME';
// Autoloader http://www.revulo.com/blog/20090524.html
require_once('Zend/Loader/Autoloader.php');
$autoloader = Zend_Loader_Autoloader::getInstance()
@fetus-hina
fetus-hina / named.conf
Last active August 29, 2015 14:01
2ch.netの名前解決ができないのでgoogleさんに解決してもらう
zone "2ch.net" { type forward; forward only; forwarders { 8.8.8.8; 8.8.4.4; }; };
zone "bbspink.com" { type forward; forward only; forwarders { 8.8.8.8; 8.8.4.4; }; };
zone "maido3.com" { type forward; forward only; forwarders { 8.8.8.8; 8.8.4.4; }; };
zone "nttec.com" { type forward; forward only; forwarders { 8.8.8.8; 8.8.4.4; }; };
zone "pinktower.com" { type forward; forward only; forwarders { 8.8.8.8; 8.8.4.4; }; };
zone "tora3.net" { type forward; forward only; forwarders { 8.8.8.8; 8.8.4.4; }; };
@fetus-hina
fetus-hina / zf1.patch
Created June 12, 2013 07:50
Zend_Validate_Hostname::decodePunycode() が "-" を含まない Punycode をデコードできない問題
--- Zend/Validate/Hostname.php.b 2013-06-12 16:36:25.000000000 +0900
+++ Zend/Validate/Hostname.php 2013-06-12 16:48:06.000000000 +0900
@@ -705,15 +705,13 @@
return false;
}
+ $decoded = array();
$separator = strrpos($encoded, '-');
if ($separator > 0) {
for ($x = 0; $x < $separator; ++$x) {
<?php
class PunpunmaruLogRoute extends CLogRoute {
public $output = STDERR;
public $words = array(
'profile' => 'おこ',
'trace' => 'まじおこ',
'info' => '激おこぷんぷん丸',
'warning' => 'ムカ着火ファイヤー',
'error' => '激おこスティックファイナリアリティぷんぷんドリーム',
);
@fetus-hina
fetus-hina / CentOS 5.9
Last active December 14, 2015 07:09
# yum remove python @CentOS 5.9/SL 6.3
[root@mai ~]# yum remove python
Loaded plugins: allowdowngrade, downloadonly, fastestmirror, priorities
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package python.x86_64 0:2.4.3-56.el5 set to be erased
--> Processing Dependency: python(abi) = 2.4 for package: python-libs
--> Processing Dependency: python(abi) = 2.4 for package: python-elementtree
--> Processing Dependency: python(abi) = 2.4 for package: libxml2-python
--> Processing Dependency: python(abi) = 2.4 for package: libuser
@fetus-hina
fetus-hina / gist:4278593
Created December 13, 2012 18:40
「Yii Framework の AR で関数通した結果を取得できないの?」とか言ってた結果現在こうなってる
<?php
class Stations extends CActiveRecord {
public $distance;
// ^^^^^^^^^^^^^^^^^
// (omit)
public function byLocation($lat, $long, $limit = 2000) {
$self = $this->getTableAlias(false, false);
$func = "distance({$self}.location, POINT(:latitude, :longitude))";
$this->getDbCriteria()->mergeWith(array(