Skip to content

Instantly share code, notes, and snippets.


Hai Pham haipham

  • Việt Nam
View GitHub Profile
haipham /
Created Nov 10, 2020 — forked from esperlu/
MySQL to Sqlite converter
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
haipham /
Created Sep 9, 2020 — forked from tombigel/
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in's Wayback Machine

Mac OS X

To check the current limits on your Mac OS X system, run:

haipham /
Created Aug 11, 2020 — forked from faressoft/
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance


  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
    • Builds CSSOM tree from the css rules.
haipham / index.js
Created Jun 30, 2020 — forked from jinseokoh/index.js
View index.js
import Vue from 'vue'
import store from '~/store'
import Meta from 'vue-meta'
import routes from './routes'
import Router from 'vue-router'
import { sync } from 'vuex-router-sync'
haipham / bosco_archive.php
Created Dec 26, 2019 — forked from pommiegranit/bosco_archive.php
WordPress theme changes when adding category featured images
View bosco_archive.php
* @package Bosco
if ( is_category() && function_exists('category_image_src')) {
$category_image = category_image_src( array( 'size' => 'full' ) , false );
} else {
$category_image = '';
View dimox_breadcrumbs.php
* WordPress Breadcrumbs
* author: Dimox
* version: 2017.21.01
* license: MIT
function dimox_breadcrumbs() {
/* === OPTIONS === */
haipham / custom-nav-walker-usage.php
Created Feb 9, 2018 — forked from kosinix/custom-nav-walker-usage.php
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
View custom-nav-walker-usage.php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
haipham / remove-export-links.php
Created Feb 4, 2018 — forked from andrasguseo/remove-export-links.php
Remove export links from The Events Calendar
View remove-export-links.php
View autorun.js
var subscribers = []
var activeJob = null
var a = 3
var state = {
get a () {
if(subscribers.indexOf(activeJob) < 0){
return a
haipham / OpenCartValetDriver.php
Created Dec 24, 2016 — forked from mikkpokk/OpenCartValetDriver.php
Laravel Valet Driver - OpenCart 2.x
View OpenCartValetDriver.php
class OpenCartValetDriver extends ValetDriver
* Determine if the driver serves the request.
* @param string $sitePath
* @param string $siteName
* @param string $uri
You can’t perform that action at this time.