Skip to content

Instantly share code, notes, and snippets.

View yuezk's full-sized avatar
💭
I may be slow to respond.

Kevin Yue yuezk

💭
I may be slow to respond.
View GitHub Profile
@jv-k
jv-k / bump-version.sh
Last active January 15, 2024 02:49
This script automates bumping the git software project's version using automation ⚠️ For an updated version, please see https://github.com/jv-k/ver-bump — a CLI module you can use with your projects ⚠️
#!/bin/bash
#
# █▄▄ █░█ █▀▄▀█ █▀█ ▄▄ █░█ █▀▀ █▀█ █▀ █ █▀█ █▄░█
# █▄█ █▄█ █░▀░█ █▀▀ ░░ ▀▄▀ ██▄ █▀▄ ▄█ █ █▄█ █░▀█
#
# Description:
# - This script automates bumping the git software project's version using automation.
# - It does several things that are typically required for releasing a Git repository, like git tagging,
# automatic updating of CHANGELOG.md, and incrementing the version number in various JSON files.
@gengwg
gengwg / deepin20.md
Last active March 23, 2024 21:06
Upgrade to deepin 20 from deepin 15.11
  1. Change the source in /etc/apt/sources.list to
    deb [by-hash=force] https://community-packages.deepin.com/deepin/ apricot main contrib non-free
  1. Add the official source for app store in /etc/apt/sources.list.d/appstore.list. If no such a list file, please create one there and add below source:
@yuezk
yuezk / numeric_literal_regexp.js
Last active August 7, 2019 05:22
[ECMAScript] Regexp to match the JavaScript numberic literal value (Supports number seprator)
// Reference: http://www.ecma-international.org/ecma-262/10.0/index.html#prod-NumericLiteral
(function () {
const regexp = /^[+-]?(?:0b[01]+|0o[0-7]+|0x[0-9a-f]+|(?:(?:(?:0|[1-9]\d*)\.\d*|\.\d+|(?:0|[1-9]\d*))(?:e[+-]?\d+)?))$/i;
// RegExp below also supports number spearator: https://github.com/tc39/proposal-numeric-separator
// const regexp = /^[+-]?(?:0b[01](_?[01])*|0o[0-7](_?[0-7])*|0x[0-9a-f](_?[0-9a-f])*|(?:(?:(?:0|[1-9](_?\d(_?\d)*)?)\.(\d(_?\d)*)?|\.\d(_?\d)*|(?:0|[1-9](_?\d(_?\d)*)?))(?:e[+-]?\d(_?\d)*)?))$/i;
const testCases = [
'0.', '0.E1', '0.e-1','0.e0', '0.1', '0.12', '0.12e2', '0.12e-2','0.12E0','0.0e1', '0.0e-1', '0.0E0',
'1.', '1.E1', '1.e-1','1.e0', '1.1', '1.12', '1.12e2', '1.12e-2','1.12E0','1.0e1', '1.0e-1', '1.0E0',
'1_0.', '1_0_0.', '1_0.0_1_2', '1_0_0', '100_000', '1e1_2', '1e+12_0', '.1_2_3', '.000_111', '10_1.1_2_3', '0.000_111', '0e0', '1_2e10',
const MODULE_DIR = /(.*([\/\\]node_modules|\.\.)[\/\\](@[^\/\\]+[\/\\])?[^\/\\]+)([\/\\].*)?$/g;
{
loader: 'babel-loader',
test: /\.jsx?$/,
include(filepath) {
if (filepath.split(/[/\\]/).indexOf('node_modules')===-1) return true;
let pkg, manifest = path.resolve(filepath.replace(MODULE_DIR, '$1'), 'package.json');
try { pkg = JSON.parse(fs.readFileSync(manifest)); } catch (e) {}
return !!(pkg.module || pkg['jsnext:main']);

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@nrollr
nrollr / nginx.conf
Last active June 9, 2024 23:39
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active June 7, 2024 20:53
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@thisismitch
thisismitch / le-renew-webroot
Last active April 26, 2024 04:13
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@mareksuscak
mareksuscak / bump-version.sh
Created March 15, 2015 12:56
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"