Skip to content

Instantly share code, notes, and snippets.

View lbngoc's full-sized avatar
🏠
Working from home

Luong Bao Ngoc lbngoc

🏠
Working from home
View GitHub Profile
@bsorrentino
bsorrentino / cordova-plugin-guide.md
Last active January 29, 2025 14:11 — forked from mlynch/cordova-plugin-guide.md
Cordova Plugin Developer Guide

Cordova Plugin Development Guide for Android

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

This simple guide, walks through the what, when, why, and how of Cordova plugin development for Android.

Introduction

Before start, understand their

@eloypnd
eloypnd / dnsmasq_setup_osx.md
Last active July 4, 2025 01:04
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active March 29, 2025 18:40
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@MicBrain
MicBrain / metatags.html
Last active February 10, 2025 20:23
The list of useful meta tags used in HTML5 documents.
<html>
<head>
<!--Recommended Meta Tags-->
<meta charset="utf-8">
<meta name="language" content="english">
<meta http-equiv="content-type" content="text/html">
<meta name="author" content=”Rafayel Mkrtchyan”>
<meta name="designer" content=”Rafayel Mkrtchyan”>
<meta name="publisher" content=”Rafayel Mkrtchyan”>
@cocoaNib
cocoaNib / exportOptionsAdHoc.plist
Last active July 3, 2025 09:38
Xcode build with exportOptionsPlist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>
@campsjos
campsjos / index.html
Created November 17, 2015 19:29
Paper.js canvas responsive resizing
<html>
<head>
<style>
#canvas {
width:100%;
}
</style>
</head>
<body>
<canvas id="canvas" width="800" height="600" resize />
@chales
chales / sed cheatsheet
Last active January 3, 2023 13:57 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@kkiernan
kkiernan / index.html
Last active August 3, 2024 06:38
A Vue.js filter that formats a phone number.
<input type="text"
name="home_phone"
class="form-control"
v-model="homePhone | phone"
lazy>
@crypticsoft
crypticsoft / gist:3932aebf97414824ebd2
Created May 9, 2015 17:52
WP backup shell script using wp-cli and aws-cli
#!/bin/bash -e
export THEDATE=`date +%d%m%y%H%M`
export THETHEME=`wp --allow-root theme list --status=active --field=name`
export THESITE=`wp --allow-root option get siteurl | awk -F/ '{print $3}'`
export THEBACKUPS="/usr/share/nginx/backups"
export THEBASEPATH="/usr/share/nginx/www"
export THEBUCKET="bucket-name-goes-here"
# backup the db
wp --allow-root db export - | gzip > ${THEBACKUPS}/dbbackup_${THEDATE}.sql.gz
@acusti
acusti / install.sh
Last active May 3, 2022 03:39
WordPress install script using WP-CLI: supports Multisite, MAMP, local php.ini overrides, and theme and plugin scaffolding, and will generate optimized .gitignore and .htaccess files.
#!/bin/bash
# Install WordPress
# =================
# Based on many sources, but originally based on:
# @ http://premium.wpmudev.org/blog/set-up-wordpress-like-a-pro/
# See also: http://wprealm.com/blog/wordpress-wp-cli-kung-fu-made-simple/
# BEGIN Configuration