Skip to content

Instantly share code, notes, and snippets.

@forzamilan
forzamilan / seq_mongo_auto.php
Last active February 2, 2016 14:46 — forked from debojitkakoti/seq_mongo_auto.php
Auto Incrementing Sequence in mongodb using php mongo
<?php
$m = new MongoClient();
// select a database
$db = $m->seq;
// select a collection (analogous to a relational database's table)
$collection = $db->counters;
$user_collection = $db->user;
@forzamilan
forzamilan / example.php
Created February 2, 2016 14:48 — forked from dimzon/example.php
Persisting PHP sessions into mongodb (allows NLB without affinity)
<?php
// all default values
MongoSessionPersistence::create()
->connect()
->register();
// connect to concrete server/db
MongoSessionPersistence::create()
->connect('mongodb://mongo_server:27017', 'databaseName')
->useLifeTime(60*60) // lifetime=1 hour
#!/bin/bash
# This script installs WordPress from Command Line.
#Colors settings
BLUE='\033[0;34m'
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
@forzamilan
forzamilan / datatables_text.js
Created August 20, 2023 19:08
upgade for existing html table on external page
customjsReady('.leaderboard-text', function(element) {
//alert('leaderboard loaded');
//add html footer
$('.character-leaderboard-table').append('<tfoot><tr><td></td><td></td><td></td><td style="text-align: right;padding-right: 15px;"></td><td style="text-align: right;padding-right: 15px;"></td><td style="text-align: right;padding-right: 15px;"></td><td style="text-align: right;padding-right: 5px;"></td><td></td><td></td></tr></tfoot>');
//fancy styling
$('.character-leaderboard-table tbody td:nth-child(4)').css({
'text-align': 'right',
'padding-right': '15px'
});
$('.character-leaderboard-table tbody td:nth-child(5)').css({