This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- static flattr button --> | |
<a href="https://flattr.com/submit/auto?user_id=YOURFLATTRUSERNAME&url={{url absolute="true"}}&title={{encode title}}&description={{excerpt}}&language=nl_NL&tags={{tags autolink="false" separator=","}}&hidden=0&category=text"> | |
<img src="https://flattr.com/_img/icons/flattr_logo_16.png" alt="Flattr Button"/> | |
</a> | |
<!-- end static flattr button --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mongo_host = 'mongodb://10.10.10.10/'; //vul hier jou ip adres in van je MongoDB omgeving | |
$m = new MongoClient($mongo_host); | |
$db = $m->blog; //maak connectie met database | |
$collection = $db->visits; // maak connectie met de tabel / collection | |
//je kan nu bijvoorbeeld al alle records tellen met | |
$nr = $collection->count(); | |
echo "<p>aantal records in db : " . $nr . "</p>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$m = new MongoClient(); // connect to local mongodb | |
$db = $m->products; //select 'mongo database' named products | |
$clothing_col = $db->clothing; //create a collection from the 'table' clothing | |
//create the aggregation | |
//create the Match on clothing-category | |
$ops = array( | |
array( | |
'$match' => array("category" => 'socks') | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$m = new MongoClient(); // connect to local mongodb | |
$db = $m->products; //select 'mongo database' named products | |
$clothing_col = $db->clothing; //create a collection from the 'table' clothing | |
//create the aggregation | |
//create the Match on clothing-category and brand | |
$ops = array( | |
array( | |
'$match' => | |
array('$and' => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$m = new MongoClient(); // connect to local mongodb | |
$db = $m->products; //select 'mongo database' named products | |
$clothing_col = $db->clothing; //create a collection from the 'table' clothing | |
$brands = array('nike', 'puma'); | |
//create the aggregation | |
//create the Match on clothing-category = shoes or brand = array | |
$ops = array( | |
array( | |
'$match' => array('$and' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$m = new MongoClient(); // connect to local mongodb | |
$db = $m->products; //select 'mongo database' named products | |
$clothing_col = $db->clothing; //create a collection from the 'table' clothing | |
$brands = array('nike', 'puma'); | |
//create the aggregation | |
//create the Match on pricing bigger or equals 75 | |
$ops = array( | |
array( | |
'$match' => array('price' => array('$gte' => '75')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zend Framework | |
* | |
* LICENSE | |
* | |
* This source file is subject to the new BSD license that is bundled | |
* with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: | |
* http://framework.zend.com/license/new-bsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: theovandersluijs | |
* Date: 14/01/15 | |
* Time: 21:18 | |
*/ | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
require_once '../Zend/blogger.php'; //don't forget you need this file also! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Force file syncronization and lock writes | |
mongo admin --eval "printjson(db.fsyncLock())" | |
MONGODUMP_PATH="/usr/bin/mongodump" #this should be the path to mongodump | |
MONGO_HOST="localhost" #different when not on same server | |
MONGO_PORT="27017" #could be different | |
MONGO_DATABASE="[dbname]" #name of your db | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createpw(strHash:String = 'abchefghjkmnpqrstuvwxyz0123456789',lnHash:Number = 5):String | |
{ | |
var i:Number = 0; | |
var hash:String = ""; | |
var nLenght:Number = strHash.length; | |
while (i <= lnHash) | |
{ | |
var num:Number = Math.round(Math.random()*nLenght); | |
hash += strHash.charAt(num); | |
i++; |
OlderNewer