Skip to content

Instantly share code, notes, and snippets.

@agamemnus
agamemnus / 1) Install
Created December 4, 2018 04:02 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
// Add a setTimeout and setInterval to HTMLElement. The setTimeout and setInterval remove themselves if the element is removed.
// Another possible implementation: global service.
HTMLElement.prototype.setTimeout = function (callback, calltime) {
var current_element = this
function is_attached (obj) {
while (true) {
obj = obj.parentNode
if (obj == document.documentElement) return true
if (obj == null) return false
}