Skip to content

Instantly share code, notes, and snippets.

@antruongnguyen
antruongnguyen / 0_reuse_code.js
Created June 23, 2016 09:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

#Windows eclipse.exe -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044

#Mac /eclipse.app/Contents/MacOS/eclipse -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044

#Note Port 1044 could be changed

@antruongnguyen
antruongnguyen / delete_git_submodule.md
Last active September 14, 2018 04:07 — 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 <name>"
  • Delete the now untracked submodule files rm -rf path_to_submodule
@antruongnguyen
antruongnguyen / install-xdebug-on-macOs-Mojave-header-issue.md
Last active October 11, 2018 07:26
Installing xdebug on macOs Mojave - 'php.h' file not found

Installing xdebug on macOs Mojave - 'php.h' file not found

Reinstall the command line tools

xcode-select --install

Reinstall the header files

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
@antruongnguyen
antruongnguyen / kill_all_processes_with_name_macos.md
Created December 20, 2018 07:21
How to kill all processes with the same name on macOS Terminal

Use pkill

pkill -f <process_name>

Use killall

killall <process_name>
@antruongnguyen
antruongnguyen / Uninstall_JDK_on_macOS.md
Last active December 26, 2018 07:49
Uninstall the JDK on macOS

To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.

Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format: /Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk

For example, to uninstall 8u6: rm -rf jdk1.8.0_06.jdk

Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.

@antruongnguyen
antruongnguyen / firebase_realtime_db_in_javascript.js
Created January 16, 2019 09:36
Recap Firebase Realtime Database for Web
// <script src="https://www.gstatic.com/firebasejs/5.4.0/firebase.js"></script>
// Initialize Firebase
var project_id = "FIREBASE_PROJECT_ID";
var config = {
apiKey: "API_KEY",
authDomain: project_id + ".firebaseapp.com",
databaseURL: "https://" + project_id + ".firebaseio.com",
projectId: project_id,
storageBucket: project_id + ".appspot.com",
@antruongnguyen
antruongnguyen / xdebug_devilbox_phpstorm_postman.md
Created July 19, 2019 07:29 — forked from marcandreappel/xdebug_devilbox_phpstorm_postman.md
Using Xdebug on Devilbox with PhpStorm and Postman

Host OS

Tested on:

  • openSUSE 15.1 Leap
  • Fedora 30

Check before setup:

  • Accept in the firewall the port 9000 TCP

Docker

@antruongnguyen
antruongnguyen / loading.css
Created July 30, 2019 07:38
CSS Loading Icon
.loading {
height: 40px;
width: 40px;
background: transparent;
border-radius: 50%;
border: 2px solid rgba(0, 0, 0, 0.3);
border-top: 2px solid #1d9af2;
animation: spinner 500ms linear infinite;
}
@antruongnguyen
antruongnguyen / embedded-file-viewer.md
Created August 27, 2019 04:36 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links