Given a set of documents, each associated with multiple tags, how can I retrieve the documents tagged with an arbitrary set of tags?
My solution
$(function () { | |
"use strict"; | |
// for better performance - to avoid searching in DOM | |
var content = $('#content'); | |
var input = $('#input'); | |
var status = $('#status'); | |
// my color assigned by the server | |
var myColor = false; |
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast) | |
(function poll(){ | |
$.ajax({ url: "server", success: function(data){ | |
//Update your dashboard gauge | |
salesGauge.setValue(data.value); | |
}, dataType: "json", complete: poll, timeout: 30000 }); | |
})(); |
<?php | |
class Bar extends Eloquent { | |
public function foo() { | |
return $this->belongsTo('Foo'); | |
} | |
} |
<?php | |
// Does string contain letters? | |
function _s_has_letters( $string ) { | |
return preg_match( '/[a-zA-Z]/', $string ); | |
} | |
// Does string contain numbers? | |
function _s_has_numbers( $string ) { | |
return preg_match( '/\d/', $string ); |
server { | |
listen 80 default_server; | |
server_name example.com www.example.com; | |
access_log /srv/www/example.com/logs/access.log; | |
error_log /srv/www/example.com/logs/error.log; | |
root /srv/www/example.com/public; | |
index index.php index.html; |
#!/usr/bin/env bash | |
# install mdbtools first! | |
# mdbtools: https://github.com/brianb/mdbtools | |
# ref: https://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL | |
DBMS=postgres | |
for MDB in `ls | grep .mdb$` |
echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <sender@mail.com>" recipient@mail.com |