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
#mapping | |
"statusForSuggest": { | |
"type": "object", | |
"properties": { | |
"isVisible":{ | |
"type": "boolean" | |
}, | |
"status":{ | |
"type": "string" |
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
BasicDBObject doc = new BasicDBObject( "name", "Matt" ); | |
collection.insert( doc ); | |
ObjectId id = (ObjectId)doc.get( "_id" ); |
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
{ | |
"settings": { | |
"number_of_shards": 5, | |
"number_of_replicas": 0 | |
}, | |
"mappings": { | |
"user": { | |
"dynamic": "strict", | |
"properties": { | |
"firstName": { |
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
$attr = array( | |
'id' => 112, | |
'username' => 'test', | |
'name' => 'test' | |
); | |
$user = new GenericUser($attr); | |
$auth = Auth::login($user); |
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
\Blade::setContentTags('<%', '%>'); // for variables and all things Blade | |
\Blade::setEscapedContentTags('<%%', '%%>'); // for escaped data |
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
$eventManager = $e->getApplication()->getEventManager(); | |
$eventManager->attach(MvcEvent::EVENT_DISPATCH, | |
function($e) | |
{ | |
$request = $e->getRequest(); | |
if ($request instanceof ConsoleRequest) | |
{ | |
return; | |
} |
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
$sql = new Sql($this->adapter); | |
$select = $sql->select()->columns(array('c.city', 'c.state', 's.count'), false) | |
->from(array('s' => 'statistic')) | |
->join(array('c' => 'city'), 's.city_id = c.id'); |
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 onBootstrap(MvcEvent $e) | |
{ | |
$application = $e->getApplication(); | |
$em = $application->getEventManager(); | |
$sharedEm = $em->getSharedManager(); | |
$listener = $application->getServiceManager()->get('Event\Factory\Listener\LogEvents'); | |
$sharedEm->attachAggregate($listener); | |
} |
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
[Unit] | |
Description=Marrow Task | |
[Service] | |
Type=simple | |
ExecStart=/marrow.task/worker.py | |
[Install] | |
WantedBy=multi-user.target |
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
import requests | |
key = 'key' | |
sandbox = 'url' | |
recipient = '[email protected]' | |
def sendEmail(): | |
request_url = 'https://api.mailgun.net/v3/{0}/messages'.format(sandbox) | |
request = requests.post(request_url, auth=('api', key), data={ |
NewerOlder