You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias subl="open -a /Applications/Sublime\ Text.app"
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/${HOME}/Practice/Python-Google-SDK/google-cloud-sdk/path.bash.inc' ]; then source '/${HOME}/Practice/Python-Google-SDK/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/${HOME}/Practice/Python-Google-SDK/google-cloud-sdk/completion.bash.inc' ]; then source '/${HOME}/Practice/Python-Google-SDK/google-cloud-sdk/completion.bash.inc'; fi
# lockmac
alias lockmac="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# edit alias config of Git with subl.
alias git-alias="subl ~/.gitconfig"
alias changed-files="git log --name-only --oneline"
# keep wifi on
alias keepwifion="sudo pmset -a sleep 0"
# use alias to run Shared of mvn build
alias mvn-start="mvn -PautoInstallPackage clean install"
# use alias to open Brackets
alias bracket="open -n /Applications/Brackets.app/"
# export Wine PATH
# export PATH=/opt/local/bin/wine:$PATH
# export PATH=/Users/admin/Wine\:$PATH
alias wins="open -a /Applications/Wine\ Stable.app"
# use alias to open Irfanview, require Wine
alias irfan="wins /${HOME}/.wine/drive_c/Program\ Files\ \(x86\)/IrfanView/i_view32.exe"
alias batch-img="wins /${HOME}/.wine/drive_c/Program\ Files\ \(x86\)/IrfanView/i_view32.exe"
# use alias to open ExamDiff, require Wine
alias xdiff="wins /${HOME}/.wine/drive_c/Program\ Files/ExamDiff\ Pro/ExamDiff.exe"
# use alias to open pdf24, require Wine
# ls alias for color display
alias ls='ls -G'
alias lsrt='ls -alrt'
# check processor on MBP
alias specs-mac-processor='sysctl -n machdep.cpu.brand_string'
# timestamp
alias timestamp='date +"%Y-%m-%d %T"'
# launch chrome
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome &"
# youtube-dl
alias mp3-dl="cd /${HOME}/Music && youtube-dl -o '%(title)s.%(ext)s' --extract-audio --audio-format mp3"
# pdf24
alias pdf24="wins /${HOME}/.wine/drive_c/Program\ Files\ \(x86\)/PDF24/pdf24-Creator.exe"
# aem4502 for mobile testing
alias aem4502="/${HOME}/Dev/ngRok-server/ngrok http 4502"
alias aem4503="/${HOME}/Dev/ngRok-server/ngrok http 4503"
alias aem4508="/${HOME}/Dev/ngRok-server/ngrok http 4508"
alias aem4509="/${HOME}/Dev/ngRok-server/ngrok http 4509"
alias aem3000="/${HOME}/Dev/ngRok-server/ngrok http 3000"
# sdkmanager
alias sdkmanager="/${HOME}/Library/Android/sdk/tools/bin/sdkmanager"
# docker
alias dkall="docker container list --all"
alias dklist="docker ps -a"
alias dkls="docker ps -a"
alias dkimages="docker image list"
alias dkstop="docker container stop"
alias dkrm="docker container rm"
alias dkrmi="docker rmi"
# brew services for mongoDB
alias mongo-start="brew services start mongodb"
alias mongo-stop="brew services start mongodb"
alias brew-list="brew services list"
alias brew-mongo="sudo lsof -iTCP -sTCP:LISTEN | grep mongo"
alias pg-start="brew services start postgresql"
alias pg-stop="brew services stop postgresql"
alias pg-restart="brew services restart postgresql"
alias mysql-start="brew services start mysql"
alias mysql-stop="brew services stop mysql"
alias mysql-restart="brew services restart mysql"
# TOMCAT
alias tomcat-start="cd /Users/admin/Practice/Tomcat/apache-tomcat-9.0.2/bin && ./catalina.sh start"
alias tomcat-stop="cd /Users/admin/Practice/Tomcat/apache-tomcat-9.0.2/bin && ./shutdown.sh"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rainbow Brackets, Emmet everywhere, Database Navigator, Material Theme UI, React snippets by jinsihou, Json sorter, google-java-format, sbt, scala
IntelliJ settings##:
Uncheck unterminated statement, Code Style Javascript - indent by 2 spaces, Surround selection on typing quote or brace, HTML generated quote marks - Single
VS Code plugins ##:
Cloudfoundry Manifest YML Support, IntelliJ IDEA Keybindings,
Git: minimum GitLens, Git Graph, Git History (exploratory & evaluating)
Code for SSH: Remote - SSH
AI-driven code: GitHub Copilot, IntelliCode, IntelliCode API Usage Examples,
Themes: Dracula Official theme (optional), Dracula IntelliJ theme (optional), Atom Material Theme, Community Material Theme (optional), Bracket Pair Colorizer (deprecated, native in VSCode now)
Java: Extension Pack for Java, Debugger for Java, Test Runner for Java, Maven for Java, Project Manager for Java, Lombok Annotations Support for VS Code, Language Support for Java(TM) by Red Hat, Javadoc Tools
UI: ES7+ React/Redux/React-Native snippets, Live Server
Code quality: SonarLint, Dependency Analytics
Doc: XML by RedHat, XML to JSON by Bui Anh Thang
AFTER MacOS key swapping for regular use of Ctrl button than Cmd, the following applies:
Code | Reformat Code... for the whole file or Code | Auto-Indent Lines for the current line or selection.
You can customise the settings for how code is auto-formatted under preferences -> Editor -> Code Style. Several comments below were asking how to ensure comments also indent to the same level as the code to which they refer. You can achieve this as follows (see screenshot), in this example for JavaScript. src: https://stackoverflow.com/questions/9044472/correct-indentation-in-intellij
CTRL + Alt + L: correct indentation (auto-indent lines)
CTRL + Delete: delete entire line
CTRL + X: cut entire line where caret is, without having to select the line
CTRL + C: copy entire line where caret is, without having to select the line
CTRL + L: select entire line
Alt + arrowUp: expand selection
Alt + Enter(Return in Mac): auto completion
CTRL + hover view Type definition, choose option from context menu to proceed further for more detail view
CTRL + left-click to go to Type definition, choose option from context menu to proceed further for more detail view
Cmd + Space Auto-completion if the project<language,code> has Type support.
Definition: Ctrl + Y | Alt + Space
Declaration: Ctrl + B
Move line up|down: CTRL+SHIFT+arrow
Goto Line: Cmd + L
Select next occurrrence: Cmd + G, to unselect: Cmd + Shift + G
select all occurrences: CTRL + Cmd + G
(For selection with the proposed keystroke setting .jar file, Windows users can use Alt in lieu of Cmd to perform similar actions)
multiple carets/cursors: ALT + SHIFT + left-click
Navigate to the next/previous change in the editor Cmd + Alt + Shift + Arrow
Navigate errors in the current file F2 | Shift + F2
For current viewing file, find Previous change by F9, next change by F10
To switch files, view recently closed files CTRL + E
Find class Ctrl + O, Find a FILE : Ctrl + Shift + O
To fix errors on installing a new app (e.g. YARN) bash: line 98: /Users/admin/.bashrc: Permission denied
consider running this:
sudo chmod 777 /Users/admin/.bashrc
sudo chmod 777 ~/.bash_profile
General Mac keystrokes:
sudo -i : root privilege
Space: to open Image in MAC
Ctrl + Alt + Esc (Mac): clt+alt+del in Windows
Ctrl + Space : to open spot light Search and Terminal
Ctrl + Alt + J : to open Chrome console in Mac
Shift + Ctrl + 3|4 for screenshot
Ctrl + Shift + H : home (pristinetran) in Finder
Cmd + L: go to Line (c9io: Cmd+G)
F6|F7: Previous|Next Change
F9|F10: Previous|Next Diff
Ctrl + .: Collapse|Expand (c9io: Alt + F2)
TYPESCRIPT
Depending on the context, there are different ways to get type information. (Shortcuts for OS X)
View > Expression Type ⌘⇧P: shows a popup
Navigate > Type Declaration ⌘⇧B: navigates in the editor
If 2. does not help, I do Navigate > Declaration ⌘B and then 2.
View > Quick Definition ⌥Space (or ⌘Y)
View > Parameter Info ⌘P: shows a popup with the declaration of a function parameter
For specific linter results only (as results from linters are internally handled as separate Inspections) you may use "Code | Run Inspection by Name..."
so you can certainly do that when you create the branch
but there is always the possibility that there have been updates to develop after you created your new branch
so for this it doesnt matter because you don't intend to pull anything back into develop; you are just testing that your branch makes it to stash
but in the future is what you would do is make your commit, check out develop and pull, then check your branch back out and merge develop into it
fix any conflicts if they exist
[3:17]
then git push origin HEAD
[3:18]
that way your current branch has everything from develop and when you do a pull request there will be no conflicts
STASH
git add --all
git status
git stash : save local changes to a stash, e.g. stash[0]
git stash : save additional local changes to another stash[1], stash[2]
git checkout develop to switch back to develop branch
git pull to update from develop branch
git checkout -b just-another-new-branch
git stash apply and git stash pop to retrieve local changes
git stash listgit stash clear
Easiest way is to rebase your feature branch onto develop, using
git checkout develop
git rebase --onto develop origin/release/XXXXX feature/yourFeatureBranch
Using this form of rebase --onto selects all the changes made in yourFeatureBranch that weren't part of develop. It's wise to double-check the result.
Proceed normally (as described above) to commit using a PR for merge to develop.
CTRL + Cmd + G: select all occurrences
Definition: Cmd + Y | Cmd + Space
Declaration: Cmd + B
Select next occurrrence: Ctrl + G, to unselect: Ctrl + Shift + G
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it’s a good idea to “freeze” the current state of the environment packages.
To do this, run
'''
$ pip freeze > requirements.txt
$ pip3 freeze > requirements3.txt
''' This will create a requirements.txt file, which contains a simple list of all the packages in the current environment, and their respective versions.
You can see the list of installed packages without the requirements format using “pip list”.
Later it will be easier for a different developer
(or you, if you need to re-create the environment) to install the same packages using the same versions:'''
$ pip install -r requirements.txt
'''
This can help ensure consistency across installations, across deployments, and across developers.
Lastly, remember to exclude the virtual environment folder from source control by adding it to the ignore list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I havn't used Jasmine in a while but every time I have evaluated it in the past I liked Mocha better
Mocha has a stronger plugin architecture and support, and supports both TDD and BDD test syntax
Jasmine and Mocha are testing frameworks and they work for any JavaScript, browser or server
PhantomJS is a headless browser.
Karma is a test runner and basically a wrapper around all of the tech you want to use for your testing.
Protractor is a webdriver implementation for writing end user GUI tests
can Protractor be considered as for BDD? >> it's an API to interface with the browser, so you can use it in BDD tests
I would say its more appropriate to use with BDD yeah since in the browser you would be testing actual behavior
Istanbul is a wrapper like Karma ? >> istanbul measures code coverage and I think it integrates with several testing frameworks.
it evaluates how much of the codebase your tests cover
so your tests themselves have to load the code that is being tested, and it looks at what lines are being executed in the codebase
___
I would say it's just technical debt.
they were probably working at some point and then stagnated
I played lightly with Jasmine and Mocha before and usually, I created a singleton so whenever I run the script like `mocha test.js`, it will go and grab all the *.test.js in the proj directory (using `glob` pattern in NodeJS).
but that’s server side, for client-side I’m not quite sure with ES5.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
/* Source Map Options */
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1-time thing for installing packages with the npm registery (to use another registry, alter the http part) - this way of doing is less favorable to the .npmrc way: npm config set registry http://registry.npmjs.org/
git push -u origin my_branch:remote_branch
Subsequent pushes will go where you want.
EDIT:
As per the comment, that only sets up pull.
git branch --set-upstream
should do it.
To remove all untracked files, whether they are ignored or not, use the command git clean -f -x instead. The -x option removes all untracked files, including ignored files.
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches
git fetch upstream
# Make sure that you're on your master branch:
git checkout master
# Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that
# other branch:
git rebase upstream/master
https://stackoverflow.com/questions/34652563/using-myproject-npmrc-with-registry
https://stackoverflow.com/questions/60877361/configure-multiple-registries-in-npmrc
Set Git username and email
https://smarterco.de/set-the-username-and-email-in-git-globally-and-per-project/
.npmrc
registry=https://registry.npmjs.com
to verify:
npm config get registry
Add account as a sudoer on Mac: https://zwbetz.com/add-your-account-as-a-sudoer-on-mac/
1-time thing for installing packages with the npm registery (to use another registry, alter the http part) - this way of doing is less favorable to the .npmrc way:
npm config set registry http://registry.npmjs.org/