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
var app = require('http').createServer(handler)
var io = require('socket.io')(app);
var questions = [
{
name: '',
content: '',
answer: function(input) {
return false;
}
@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;
## Safety pig has arrived!
## _
## _._ _..._ .-', _.._(`))
## '-. ` ' /-._.-' ',/
## ) \ '.
## / _ _ | \
## | a a / |
## \ .-. ;
## '-('' ).-' ,' ;
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace app\widgets;
/**
var p[], s[], n, m, f[];
doc input
// trong đó
n = length(s)
m = số phần tử của p
$link.click(function(e) {
e.preventDefault();
var headerHeight = $header.height();
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname==this.hostname) {
var $target = $(this.hash);
var topValue = $target.offset().top;
$target = $target.length ? target : $('[name=' + this.hash.slice(1) + ']');
[123,123,111]
@vuquangthinh
vuquangthinh / i18next-scanner.config.js
Created July 22, 2020 02:12
i18next scanner config with typescript support
const fs = require('fs');
const path = require('path');
const typescript = require('typescript');
const DEFAULT_NS = 'translation';
module.exports = {
input: ['src/**/*.{js,jsx,ts,tsx}'],
options: {
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io