Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@laptrinhcomvn
laptrinhcomvn / wp-bootstrap5.0-pagination.php
Created January 18, 2022 19:59 — forked from mtx-z/wp-bootstrap5.0-pagination.php
Wordpress 5.7 Bootstrap 5.0 pagination (with custom WP_Query() and global $wp_query support)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* Using Bootstrap 4? see https://gist.github.com/mtx-z/f95af6cc6fb562eb1a1540ca715ed928
*
@laptrinhcomvn
laptrinhcomvn / Google-Sheet-Form-Post.md
Created July 7, 2020 17:29 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.

Run example

You should be able to just open index.html in your browser and test locally.

@laptrinhcomvn
laptrinhcomvn / my.cnf
Created May 18, 2020 19:11 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
Steps to recreate tests:
// Create and configure server:
1. Create 2GB DigitalOcean server using Forge
2. Enable OpCache on server
3. Create http://domain1.com (use whatever domain name you have available)
4. Create http://domain2.com (use whatever domain name you have available)
5. Enable SSL on both domains using LetsEncrypt
6. Install: sudo apt-get install apache2-utils
@laptrinhcomvn
laptrinhcomvn / How to create VOD HLS Stream.md
Last active October 18, 2019 17:16 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@laptrinhcomvn
laptrinhcomvn / ResourceUtil.java
Created July 16, 2018 17:22 — forked from Gnzlt/ResourceUtil.java
Android utils class to get a Bitmap from a VectorDrawable Resource Id (Took from http://qiita.com/konifar/items/aaff934edbf44e39b04a)
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import android.os.Build;
import android.support.annotation.DrawableRes;
import android.support.graphics.drawable.VectorDrawableCompat;
@laptrinhcomvn
laptrinhcomvn / moving_from_jquery_to_vanilla.md
Last active December 10, 2016 12:16 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery to Vanilla

Events

// jQuery
$(document).ready(function() {
  // code
})

// Vanilla
@laptrinhcomvn
laptrinhcomvn / Setup Ruby on Debian Wheezy.md
Created June 18, 2016 15:45
Setup rbenv + ruby on Debian 7.1 (Wheezy)

Update and install required packages:

$ apt-get update -y
$ apt-get install -y g++ gcc make libc6-dev patch openssl ca-certificates libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev

Install ruby-build

$ git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
$ cd /tmp/ruby-build/

$ ./install.sh

@laptrinhcomvn
laptrinhcomvn / genymotionwithplay.txt
Created February 15, 2016 08:53 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@laptrinhcomvn
laptrinhcomvn / Clean Install – OS X 10.11 El Capitan.md
Last active January 14, 2016 06:49 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat