396, 4d509b2bc497b54455aac7e4863ce7dac3e1c898, NonMattis.avi
396, 4d509b2bc497b54455aac7e4863ce7dac3e1c898, VenenatisTurpis.xls
395, 65864917b1548aa1b4520a5a40511dc4e4e4af12, AmetErosSuspendisse.tiff
395, 65864917b1548aa1b4520a5a40511dc4e4e4af12, PlateaDictumst.gif
394, b738398a474808da2a9c9c0e00abecabba22acd4, AFeugiatEt.xls
394, b738398a474808da2a9c9c0e00abecabba22acd4, Amet.mp3
394, b738398a474808da2a9c9c0e00abecabba22acd4, At.avi
394, b738398a474808da2a9c9c0e00abecabba22acd4, AtVelit.png
394, b738398a474808da2a9c9c0e00abecabba22acd4, CondimentumId.xls
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
{ | |
"require": { | |
"ruflin/elastica": "^5.1", | |
"elasticsearch/elasticsearch": "^5.1" | |
} | |
} |
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 | |
curl -s -XPUT http://localhost:9200/somecorp -d '{ | |
"mappings": { | |
"employee": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"first_name": { |
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
# table storage | |
id | sha1 | count | |
----+------------------------------------------+------- | |
17 | dc9793d8f2379b73c4932d33a14c75eefa849fda | 64 | |
# table file | |
id | storage_id | name | |
-----+------------+----------------------- | |
113 | 17 | OdioCondimentumId.avi | |
114 | 17 | Venenatis.png |
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
{ | |
"_id": 17, | |
"sha1": "dc9793d8f2379b73c4932d33a14c75eefa849fda", | |
"count": 64, | |
"files": [ | |
{ | |
"id": 1, | |
"name": "OdioCondimentumId.avi" | |
}, | |
{ |
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
SELECT s.id, s.sha1, f.name | |
FROM storage s | |
JOIN file f ON s.id = f.storage_id | |
WHERE s.count > 0 | |
ORDER by id DESC, name ASC | |
OFFSET 1000 LIMIT 10 |
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
db.file_storage.aggregate([ | |
{$match: {"count": {$gt: 0}}}, | |
{$unwind: "$files"}, | |
{$project: {_id: 1, sha1: 1, "name": "$files.name"}}, | |
{$sort: {_id: -1, "name": 1}}, | |
{$skip : 1000}, | |
{$limit : 10}, | |
]) |
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 | |
class Form | |
{ | |
protected $name; | |
public function getName() | |
{ | |
return $this->name; | |
} |
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 | |
class ValueObject | |
{ | |
protected $name; | |
public function __construct(array $args) | |
{ | |
if (!isset($args['name']) || $args['name'] === '') { | |
throw new InvalidArgumentException('name cannot be blank'); |
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 | |
tid='UA-109851522-1' | |
cid=`php -r 'echo rand();'` | |
curl -i 'https://www.google-analytics.com/collect?v=1&t=event&tid='$tid'&cid='$cid'&ec=shellClick&ea=click.shell&el=cli&ev=1' |