Skip to content

Instantly share code, notes, and snippets.

View tuananhzippy's full-sized avatar

Tuấn Anh Zippy tuananhzippy

View GitHub Profile
@doraeminemon
doraeminemon / nonAccentVietnamese.js
Last active October 27, 2022 02:58 — forked from jarvisluong/nonAccentVietnamese.js
Converting standard Vietnamese Characters to non-accent ones. Example: hải -> hai
function nonAccentVietnamese(str) {
str = str.replace(/A|Á|À|Ã|Ạ|Â|Ấ|Ầ|Ẫ|Ậ|Ă|Ắ|Ằ|Ẵ|Ặ/g, "A");
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
str = str.replace(/E|É|È|Ẽ|Ẹ|Ê|Ế|Ề|Ễ|Ệ/, "E");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
str = str.replace(/I|Í|Ì|Ĩ|Ị/g, "I");
str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
str = str.replace(/O|Ó|Ò|Õ|Ọ|Ô|Ố|Ồ|Ỗ|Ộ|Ơ|Ớ|Ờ|Ỡ|Ợ/g, "O");
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o");
str = str.replace(/U|Ú|Ù|Ũ|Ụ|Ư|Ứ|Ừ|Ữ|Ự/g, "U");
@tuxity
tuxity / navicat_premium_reset_trial.sh
Last active June 12, 2024 14:00
Reset Navicat Premium 15/16/17 remaining trial days
https://github.com/tuxity/navicat-premium-reset-trial
@cupnoodle
cupnoodle / imagemagick.sh
Created December 16, 2019 17:28
Install ImageMagick on Ubuntu 18.04 with HEIF / HEIC support
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install build-essential autoconf libtool git-core
sudo apt-get build-dep imagemagick libmagickcore-dev libde265 libheif
cd /usr/src/
sudo git clone https://github.com/strukturag/libde265.git
sudo git clone https://github.com/strukturag/libheif.git
cd libde265/
sudo ./autogen.sh
sudo ./configure
@ko31
ko31 / SampleFilterAnalytics.php
Created December 19, 2018 16:17
Get reports with multiple condition filters for Google Analytics Reporting API v4
<?php
// composer require google/apiclient
/**
* @link https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-php
* @link https://developers.google.com/analytics/devguides/reporting/core/v4/samples
* @link https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet
*/
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active May 18, 2024 12:06
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@lamngockhuong
lamngockhuong / ckfinder-authentication-configuration-for-laravel.md
Created February 6, 2018 16:04
[CKFinder Authentication Configuration for laravel 5] #laravel #ckfinder #ckeditor

Open and edit file 'ckfinder/config.php':

require dirname(__DIR__, 3) .'/vendor/autoload.php';
$app = require dirname(__DIR__, 3) . '/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$kernel->handle($request = Illuminate\Http\Request::capture());

$config['authentication'] = function () {
 if (auth()-&gt;guest()) {
yum update -y
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
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
@deargle
deargle / client.conf
Last active June 1, 2024 12:32
OpenVPN server.conf and client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@chrisgannon
chrisgannon / Spin2WinWheel_doc_v0.7.md
Last active March 29, 2023 06:40
Documentation for Spin2Win Wheel, a responsive, flexible, customisable, resolution independent spin wheel game whose outcomes you control.
Release notes for updates can be found in the comments
FAQs can be found here here

Documentation for Spin2Win Wheel by Chris Gannon

Built using Scalable Vector Graphics Spin2Win Wheel is a responsive, flexible, customisable, resolution independent spin wheel game whose outcomes you control.

Spin results, prizes, win/lose, number of spins, custom data and more can be controlled using JSON data. You can set the winning probabilty for each segment and customise the look and feel of Spin2Win Wheel to bring it in line with your brand or color scheme - it even has an anti-cheat mechanism to prevent players placing the wheel on a chosen segment.

You can purchase Spin2Win Wheel by Chris Gannon from CodeCanyon here
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 23, 2023 09:38
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.