Skip to content

Instantly share code, notes, and snippets.

Lão Còi laocoi

Block or report user

Report or block laocoi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
laocoi / config.js
Created Dec 27, 2019 — forked from codediodeio/config.js
Snippets from the Firestore Data Modeling Course
View config.js
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
// Initialize Firebase
laocoi / vietnamese-slug.js
Last active Sep 18, 2019
Create Vietnamese slug from string - Javascript
View vietnamese-slug.js
function slugify(string){
const a = 'àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;'
const b = 'aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(|à|||ã|ă||||||â|||||ậ/gi, 'a')
.replace(|è||||ê|ế||||ệ/gi, 'e')
.replace(/i|í|ì||ĩ|ị/gi, 'i')
.replace(|ò||õ||ô||||||ơ|||||ợ/gi, 'o')
.replace(|ù||ũ||ư|||||ự/gi, 'u')
View svg-viewer.php
$list = [];
$err = '';
$path = filter_input( INPUT_GET, 'path');
if ( !$path )
$err = 'Path is empty';
laocoi / PHP enable CORS
Created Apr 22, 2019
The following snippet should give you a quick overview about the required HTTP headers to set for CORS to work.
View PHP enable CORS
$allowedOrigins = array(
if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
foreach ($allowedOrigins as $allowedOrigin) {
if (preg_match('#' . $allowedOrigin . '#', $_SERVER['HTTP_ORIGIN'])) {
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
header('Access-Control-Max-Age: 1000');
laocoi / remove-words.php
Created Dec 14, 2018 — forked from keithmorris/remove-words.php
PHP remove common words from a string
View remove-words.php
function removeCommonWords($input){
// EEEEEEK Stop words
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerni
laocoi / nginx.conf
Created Sep 2, 2018 — forked from jrom/nginx.conf
nginx hack for multiple conditions
View nginx.conf
if ($request_uri = /) {
set $test A;
if ($host ~* {
set $test "${test}B";
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
View Tăng size volume

Kiểm tra dung lượng hiện tại

df -h -x tmpfs -x devtmpfs

Tăng trong dashboard

Cập nhật

laocoi / Compile FFmpeg on CentOS - RHEL
Created Jun 28, 2018
This guide is in view of an insignificant establishment of the most recent CentOS discharge, and will provide a local, non-framework establishment of FFmpeg with support for a few outside encoding libraries.
View Compile FFmpeg on CentOS - RHEL

In your home directory make a new directory to put all of the source code into:

yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://
cd yasm
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
View Auto add nofollow to link -
View gist:a346a13b6d2e1ec33cb0b32652e8d1a6
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
You can’t perform that action at this time.