Skip to content

Instantly share code, notes, and snippets.

@touhonoob
touhonoob / mod_videoattach.php
Created April 14, 2012 16:10
Pixmicat youtube預覽模組,需搭配cURL & mod_bbcode
<?php
class mod_videoattach {
var $myPage;
function mod_videoattach() {
global $PMS;
$PMS->hookModuleMethod('ModulePage', 'mod_videoattach');
@touhonoob
touhonoob / app.coffee
Created April 28, 2012 08:09 — forked from jondot/app.coffee
image-gallery
class Thumb extends Backbone.Model
defaults:
uri: ''
state: ''
select: (state) ->
st = ''
st = 'selected' if state
@set('state' : st)
@touhonoob
touhonoob / mod_jscheckrenzoku.php
Created May 15, 2012 11:53
Javascript檢查發文時間
<?php
class mod_jscheckrenzoku{
const COOKIE_LASTSUBMIT = "lastSubmit";
public function mod_jscheckrenzoku() {
}
function getModuleName() {
@touhonoob
touhonoob / Ranking.php
Created June 13, 2012 09:39
Reddit Ranking Algorithms in PHP
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <lnolte@i.biz>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries
@touhonoob
touhonoob / jquery.xdomain.js
Created July 17, 2012 20:05 — forked from mathieucarbou/jquery.xdomain.js
jQuery CORS Plugin - transparently add CORS support for IE8+ in jQuery using XDomainRequest. Support cookies.
PROJECT MOVED TO https://github.com/Ovea/cors
/**
* https://gist.github.com/1114981
*
* By default, support transferring session cookie with XDomainRequest for IE. The cookie value is by default 'jsessionid'
*
* You can change the session cookie value like this, before including this script:
*
* window.SESSION_COOKIE_NAME = 'PHP_SESSION';
<?php
/**
* Clean HTML string removing all element attributes and elements which are
* not in the provided whitelist (but keeping their allowed children).
*
* @see https://github.com/alixaxel/phunction/blob/master/phunction/HTML.php
* @param string $html to clean
* @param array $whitelist
*/
function clean_html($html, array $whitelist)
https://wiki.samba.org/index.php/Samba_4/OS_Requirements#Debian_or_Ubuntu
http://www.samba.org/
@touhonoob
touhonoob / ImageMagick
Created June 15, 2013 12:52
ImageMagick installation
yum-builddep imagemagick
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar -zxf ImageMagick.tar.gz
cd ImageMagick-6.8.5
./configure
make && make install
@touhonoob
touhonoob / install
Last active December 18, 2015 16:49
pHash
apt-get install libavcodec-dev
http://www.ffmpeg.org/releases/ffmpeg-1.2.1.tar.gz
http://www.phash.org/download/
https://github.com/polachok/py-phash
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36