Skip to content

Instantly share code, notes, and snippets.

View goldalworming's full-sized avatar

arief nur andono goldalworming

View GitHub Profile
<?php
$active_group = 'default';
$active_record = FALSE;
$db['default']['hostname'] = 'Driver={SQL Server};Server=127.0.0.1;Database=databasenya; Uid=sa;Pwd=sa;';
$db['default']['username'] = 'sa';
$db['default']['password'] = 'sa';
$db['default']['database'] = 'databasenya';
$db['default']['dbdriver'] = 'odbc';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
.filter("timeago", function () {
//time: the time
//local: compared to what time? default: now
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
return function (time, local, raw) {
if (!time) return "never";
if (!local) {
(local = Date.now())
}
# ------------------------------------------------------------------
# Desigining "trending topics in 24 hours sliding window" with Redis
# ------------------------------------------------------------------
redis-cli del tophashes:2010-12-07-08-00
redis-cli del tophashes:2010-12-07-09-00
redis-cli del tophashes:current
echo '=== 8:00 AM ==='