Skip to content

Instantly share code, notes, and snippets.

Avatar

ZenWANG MrZenW

View GitHub Profile
@MrZenW
MrZenW / -how-to-configure-php-xdebug-with-docker-and-vscode.md
Last active Sep 8, 2022
How to configure PHP Xdebug with Docker and VSCode
View -how-to-configure-php-xdebug-with-docker-and-vscode.md

How to Configure PHP Xdebug with Docker and VSCode

- File list -

  • Dockerfile
  • docker-compose.yml
  • mrzenw.nginx.conf
  • php.ini
  • xdebug.ini
  • .vscode/launch.json
@MrZenW
MrZenW / how-to-delete-a-file-in-git-history.sh
Created Aug 30, 2022
If you can't push your repo to GitHub because of a large file in git history and you have even deleted it.
View how-to-delete-a-file-in-git-history.sh
# https://stackoverflow.com/a/23657759
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
View git-clone-all-branches-and-push-to-a-different-remote.md

Git clone all branches and push to a different remote

- 0x00 Initialisation -

Step 0x01 - add your own remote

# add another remote
git remote add mrzenw_github __ANOTHER_REMOTE_GIT_ADDRESS__HTTPS_OR_SSH__

Step 0x02 - create local branches as same as them in the origin repository

@MrZenW
MrZenW / SSL.md
Created Jul 16, 2020 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert
View SSL.md

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@MrZenW
MrZenW / easing.js
Created Dec 12, 2019 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
View node-command-line-options.txt
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@MrZenW
MrZenW / Base64.lua
Created May 17, 2016 — forked from bortels/Base64.lua
Base64 encode/decode for Codea (Lua)
View Base64.lua
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de>
-- licensed under the terms of the LGPL2
-- character table string
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
local r,b='',x:byte()