Skip to content

Instantly share code, notes, and snippets.

@kenny-chow-my
kenny-chow-my / gitflow-breakdown.md
Created January 21, 2019 09:48 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@kenny-chow-my
kenny-chow-my / delete_git_submodule.md
Created January 8, 2019 03:13 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@kenny-chow-my
kenny-chow-my / mongo-docker.bash
Created August 30, 2018 03:38 — forked from davideicardi/mongo-docker.bash
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
diff --git a/devportal/src/js/utils/shallowcompare.js b/devportal/src/js/utils/shallowcompare.js
new file mode 100644
index 00000000..1409ebe1
--- /dev/null
+++ b/devportal/src/js/utils/shallowcompare.js
@@ -0,0 +1,23 @@
+/**
+ * Shallow compare, inspired from
+ * https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
+ * @param {*} src object to compare
@kenny-chow-my
kenny-chow-my / xss-owasp-cheatsheet
Created February 15, 2018 03:30 — forked from sseffa/xss-owasp-cheatsheet
xss-owasp-cheatsheet
#
# https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
# based on the RSnake original http://ha.ckers.org/xss.html
# Retrieved on 2013-11-20
# Much of this wildly obsolete
#
# XSS Locator 2
'';!--"<XSS>=&{()}
@kenny-chow-my
kenny-chow-my / setup_ubuntu16_server.md
Last active June 12, 2017 16:04
Setting up new VPS

apt-get update

resize the drive

fdisk /dev/sda
Then:
    type p - to list all your partitions
    type n - to create a new partition
    type l - for "logical"
    then give it a number (e.g. if you got 2 partitions listed as /dev/sda1 & /dev/sda2, for the new partition simply type "3" to create /dev/sda3)