type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
static var httpClient = new HttpClient(); | |
Future<File> _downloadFile(String url, String filename) async { | |
var request = await httpClient.getUrl(Uri.parse(url)); | |
var response = await request.close(); | |
var bytes = await consolidateHttpClientResponseBytes(response); | |
String dir = (await getApplicationDocumentsDirectory()).path; | |
File file = new File('$dir/$filename'); | |
await file.writeAsBytes(bytes); | |
return file; | |
} |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.
Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:
ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4
Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.
// Simulate a call to Dropbox or other service that can | |
// return an image as an ArrayBuffer. | |
var xhr = new XMLHttpRequest(); | |
// Use JSFiddle logo as a sample image to avoid complicating | |
// this example with cross-domain issues. | |
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true ); | |
// Ask for the result as an ArrayBuffer. | |
xhr.responseType = "arraybuffer"; |
<?php $this->widget( 'zii.widgets.grid.CGridView', array( | |
'id' => 'product-2-group-grid', | |
'dataProvider' => $model->search(), | |
'filter' => $model, | |
'summaryText' => '{start} - {end} / {count}', | |
'selectableRows' => 2, | |
'columns' => array( | |
array( | |
'name' => 'product_code', | |
'htmlOptions' => array( 'class' => 'product_code' ), |
<?php | |
/** | |
* CAssetManager class file. | |
* | |
* @author Jason Hancock <jsnbyh@gmail.com> | |
* @copyright Copyright © 2013 Jason Hancock | |
* @license http://www.yiiframework.com/license/ | |
*/ |
server { | |
listen 1.2.3.4:443; | |
server_name railsapp.example.com; | |
ssl on; | |
ssl_certificate cert.pem; | |
ssl_certificate_key cert.key; | |
location / { | |
proxy_set_header X-Forwarded-Proto https; | |
# Sets the HTTP headers appropiately; | |
proxy_pass http://rails_application; |