Skip to content

Instantly share code, notes, and snippets.

@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 / 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)
#!/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
#! /bin/sh
#
# Based on Mike Miller's gwhitelist at:
# http://archive.mgm51.com/sources/gwhitelist.html
# Copyright (c) 2013 Mike Miller <mmiller@mgm51.com>
#
# Modified 2014 by Steve Jenkins <steve@stevejenkins.com> to format
# output for mod_remoteip on Apache with Google PageSpeed Service
#
# Permission to use, copy, modify, and distribute this software for any
<?php
use Phalcon\DI as DI;
class Dummy {
private $test;
function getTest() {
return $this->test;
}
<div id="home" data-role="page">
<div role="main" class="ui-content">
<h1>Contract On</h1>
<div class="effect">
<div class="blackball"></div>
<div class="redball"></div>
<div class="greenball"></div>
<div class="blueball"></div>
</div>
</div>
<div id="home" data-role="page">
<div role="main" class="ui-content">
<h1>Contract On</h1>
<div class="effect">
<div class="blackball"></div>
<div class="redball"></div>
<div class="greenball"></div>
<div class="blueball"></div>
</div>
</div>
@touhonoob
touhonoob / benchmark.sh
Created November 15, 2016 16:37 — forked from emersonmoretto/benchmark.sh
Apache bench + Gnuplot Script
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'