This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dùng yield để return về 1 mảng dữ liệu lớn tránh tràn bộ nhớ | |
function gen_one_to_three() { | |
for($i; $<3; $i++) { | |
yield $i; | |
} | |
} | |
---------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1920x900 | |
1280x600 | |
980x1280 | |
800x1280 | |
768x1024 | |
360x640 | |
320x480 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRealIP() | |
{ | |
if (isset($_SERVER['HTTP_CLIENT_IP'])) { | |
$ipaddress = $_SERVER['HTTP_CLIENT_IP']; | |
} else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else if (isset($_SERVER['HTTP_X_FORWARDED'])) { | |
$ipaddress = $_SERVER['HTTP_X_FORWARDED']; | |
} else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) { | |
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go to Settings, Update & security, Windows Update, Advanced options, | |
Choose how updates are delivered, Updates from more than one place. | |
Turn the switch OFF. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add user to root group | |
```bash | |
$>sudo usermod -aG sudo <username> | |
``` | |
SWAP | |
$>sudo swapon --show | |
$>free -h | |
$>df -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Toppings { | |
constructor(toppings) { | |
this.toppings = Array.isArray(toppings) ? toppings : []; | |
} | |
outputList() { | |
this.toppings.forEach((topping, i) => console.log(topping, i + '/' + this.toppings.length)) | |
} | |
} | |
var ctrl = new Toppings(['cheese', 'lettuce']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Diffusion youtube avec ffmpeg | |
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
VBR="2500k" # Bitrate de la vidéo en sortie | |
FPS="30" # FPS de la vidéo en sortie | |
QUAL="medium" # Preset de qualité FFMPEG | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function closePrint () { | |
document.body.removeChild(this.__container__); | |
} | |
function setPrint () { | |
this.contentWindow.__container__ = this; | |
this.contentWindow.onbeforeunload = closePrint; | |
this.contentWindow.onafterprint = closePrint; | |
this.contentWindow.focus(); // Required for IE | |
this.contentWindow.print(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
» » | |
« « | |
º º | |
æ æ | |
‰ ‰ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
RUN apt-get -y update && apt-get install -y php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-intl php7.0-zip php7.0-pgsql build-essential git gcc make re2c libpcre3-dev php7.0-dev curl | |
RUN curl -sS http://getcomposer.org/installer | php | |
RUN mv composer.phar /usr/local/bin/composer | |
RUN composer global require "phalcon/zephir:dev-master" | |
RUN mkdir -p /opt/www |