Skip to content

Instantly share code, notes, and snippets.

@avilamisc
avilamisc / CorsMiddleware.php
Created June 4, 2020 03:36 — forked from ArnoldLC/CorsMiddleware.php
Actualización de jwt token en LUMEN usando tymon/jwt-auth. Reference: https://github.com/tymondesigns/jwt-auth/issues/1355
/*
Modificar middleware para que el archivo JS del front pueda leer el header y actualizar el token para
las siguientes peticiones.
*/
<?php
/**
* Location: /app/Http/Middleware
*/
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@avilamisc
avilamisc / DownloadProgressCounter.java
Created February 14, 2018 21:40 — forked from tolmachevroman/DownloadProgressCounter.java
Reflect DownloadManager progress of downloading multiple files in ProgressBar widget
/**
* Fetches how many bytes have been downloaded so far and updates ProgressBar
*/
class DownloadProgressCounter extends Thread {
private final long downloadId;
private final DownloadManager.Query query;
private Cursor cursor;
private int lastBytesDownloadedSoFar;
private int totalBytes;