Skip to content

Instantly share code, notes, and snippets.

View vuquangthinh's full-sized avatar
⚠️
Warning compiled with 0 warnings

Vũ Quang Thịnh vuquangthinh

⚠️
Warning compiled with 0 warnings
View GitHub Profile
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace app\widgets;
/**
## Safety pig has arrived!
## _
## _._ _..._ .-', _.._(`))
## '-. ` ' /-._.-' ',/
## ) \ '.
## / _ _ | \
## | a a / |
## \ .-. ;
## '-('' ).-' ,' ;
@vuquangthinh
vuquangthinh / img.l
Created March 12, 2016 07:20 — forked from webmasterkai/img.l
Mirror remote image files, supports dynamic resizing of images. nginx image_filter remote fetching with a local mirror of original and resized image. Using try_files instead of if statements and proxy_pass with proxy_store for permanent local storage. No cache expiration, that will need to be handled outside of this.
server {
server_name img.l;
root /var/www/cache/store/ns365;
index index.html;
# This requests the original file from itself and then resizes the image.
location ~ /resize/(\d+)x(\d+)/(.*) {
proxy_pass http://img.l/$3;
image_filter resize $1 $2;
image_filter_jpeg_quality 90;
var app = require('http').createServer(handler)
var io = require('socket.io')(app);
var questions = [
{
name: '',
content: '',
answer: function(input) {
return false;
}