Skip to content

Instantly share code, notes, and snippets.

<?php
// Put your device token here (without spaces):
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Put your private key's passphrase here:
$passphrase = 'xxxxxxx';
// Put your alert message here:
$message = 'A push notification has been sent!';
/* Large desktop */
@media (min-width: 1200px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }
/* Landscape phones and down */
@dinhkk
dinhkk / mkgit-centos6.sh
Created August 26, 2016 08:13 — forked from eyecatchup/mkgit-centos6.sh
Bash script to install the latest Git version on CentOS 6.x.
#!/usr/bin/env bash
# Install the latest version of git on CentOS 6.x
# Install Required Packages
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
sudo yum install gcc perl-ExtUtils-MakeMaker
# Uninstall old Git RPM
sudo yum remove git
@dinhkk
dinhkk / install-comodo-ssl-cert-for-nginx.rst
Created October 4, 2016 14:49 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@dinhkk
dinhkk / secure - nginx wordpress.txt
Last active March 5, 2017 11:00
secure nginx + wordpress
1. https://lamosty.com/2015/04/14/securing-your-wordpress-site-running-on-nginx/
2. https://deliciousbrains.com/hosting-wordpress-yourself-nginx-security-tweaks-woocommerce-caching-auto-server-updates/
3. https://codeable.io/significantly-improve-wordpress-security/
<?php
/*
In this example the source media is located at
rtmp://server.test.com:1935/vod/mp4:sample.mp4
Flow player has the name split by 2 part. They are stored in respective variables below.
*/
$base_url = 'http://daohuyentrang.com:8018/videos/';
$video_url = 'dtHuong-dan-su-dung.mp4/playlist.m3u8';
@dinhkk
dinhkk / Install-php7.md
Created July 28, 2017 04:17 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@dinhkk
dinhkk / xdebug and phpstorm
Last active August 4, 2017 04:05
xdebug - phpstorm
1. create web application server
2. create sftp tunner to connect
3. mwnu: Run => Run web server validate to pass all requires
4. Config php CLI Setting => Language / Framework
Settinh for xdebug.ini
xdebug.ini
zend_extension=/usr/lib64/php/modules/xdebug.so
[xdebug]
xdebug.remote_autostart=1 ;
@dinhkk
dinhkk / letenscript.md
Last active October 16, 2017 07:27
command create ssl with letsencrypt

./letsencrypt-auto certonly -a webroot --webroot-path=/var/www/webrtc -d webrtcdemo.tk -d www.webrtcdemo.tk

create file /etc/nginx/snippets/ssl.conf

ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

ssl_protocols TLSv1.2;
@dinhkk
dinhkk / php5.6 + nginx + mariaDB on centos-7
Last active November 19, 2017 13:11
bash install centos 7
#login as root
yum update
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#install php
yum install php56w-fpm php56w-opcache
yum install php56w
yum install php56w-bcmath php56w-common php56w-devel php56w-gd php56w-imap php56w-intl php56w-ldap