Skip to content

Instantly share code, notes, and snippets.

db.getCollection("tg_vod").find({
nid: 138313
}).forEach(function(doc) {
if (doc.programaTemporada.length > 0) {
doc.programaTemporada[0].tid = doc.programaTemporada[0].tid.toLowerCase().replace(' ', '-');
}
db.tg_vod.updateOne({_id: doc._id}, {$set: {
"programaTemporada.0": doc.programaTemporada[0]
}});
})
public function login_2fa() {
try {
//code...
$google2fa = new \PragmaRX\Google2FA\Google2FA();
$credentials = request(['email', 'verification_code']);
$user = User::where('email', $credentials['email'])->first();
$window = request('working_time', true) === false ? 5 : 0;
$valid = $google2fa->verifyKey($user->secret_2fa, $credentials['verification_code'], $window);
$status = $status2 = true;
db.getCollection("an_compactov2").find({'source': 'youtube', 'media.id': null}).forEach(function (doc) {
if ( doc.portada_e && doc.portada_e.fid ) {
//print(doc.nid);
db.an_compactov2.updateOne({
_id: doc._id
}, {
$set: {
"media.id": doc.portada_e.fid
}
});
{
"_id" : ObjectId("595409c5defb38985c8b4567"),
"programaId" : "58ed0dea2e131cd07f8b4569",
"edicionId" : "2425886",
"fecha" : NumberLong(1498626000),
"fechaCreacion" : NumberLong(1498679749),
"fechaActualizacion" : NumberLong(1498685161),
"audio" : {
"lista" : [
{
function noticia_grid_cropandresize()
{
$url = variable_get('elementos_app', 0) . '/index.php/cropandresize/grid';
$post = array();
$post['apikey'] = '590ee43e919b1f4baa2125a424f03cd160ff8901';
$post['base_name']= $_POST['base_name'];
$post['fid']= $_POST['fid'];
$post['fid_path']= $_POST['fid_path'];
$post['ext']= $_POST['ext'];
$post['left']= $_POST['left'];
function site_api_send($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'MD3');
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 0);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close ($ch);
$json = json_decode($response);
<?php
//Buscar en listas ordenadas 1. ------ 2. -------
$subject = '<div class="txt-nota">
<p>Santa Clara // Solo las entidades que operen bajo el ámbito de supervisión de la Superintendencia de Banca y Seguros, listadas en la Ley General del Sistema Financiero, podrán emitir dinero electrónico, según el proyecto de ley aprobado por el Congreso de la República.</p>
<p><strong>1. El nuevo cambio</strong><br>
El proyecto beneficiará al 66% de los distritos del país y al 70% de la población que no tiene acceso al sistema financiero. “A través del celular podrán acceder al sistema financiero”, dijo Freso.</p>
<p><strong>2. El camino de recorrer</strong><br>
“La persona recibirá el abono en efectivo y lo registrará como dinero electrónico, el que puede ser utilizado a través de un celular o tarjeta plástica”. Si el usuario desea utilizar estos fondos para</p>
<p><strong>3. Fallo transición</strong><br>
Por otro lado, el Parlamento aprobó modificar divers
@jcnevado
jcnevado / insert_item_in_position_array-php
Created July 15, 2013 01:10
Inserting items in a certain position of an array.
<?php
$rows = $data = array();
for ($i=0; $i < 20; $i++) {
$rows[] = (object) array(
'id' => $i + 1,
'title' => 'test ' . rand() * 200,
'format' =>'nota',
);
}
$banners = array(
INIT
{"command": "INIT","file_name":"prueba.pdf"}
APPEND
{"command": "APPEND","file_name":"prueba.pdf", "media_id":"a276c818fbc610e1d72a0c993101c59d", "segment_index":1, "chunk":"ZGVtbw==BASE64"}
{"command": "APPEND","file_name":"prueba.pdf", "media_id":"a276c818fbc610e1d72a0c993101c59d", "segment_index":2, "chunk":"ZGVtbw==BASE64"}
@jcnevado
jcnevado / AMP
Last active December 19, 2015 09:59
<?php
//Worker.php
/* Create a connection using all default credentials: */
$connection = new AMQPConnection();
$connection->connect();
$channel = new AMQPChannel($connection);
/* create a queue object */
$queue = new AMQPQueue($channel);