Skip to content

Instantly share code, notes, and snippets.

View sbimochan's full-sized avatar
Sherlock Holmes mode

Bimochan Shrestha sbimochan

Sherlock Holmes mode
View GitHub Profile
sbimochan /
Last active May 26, 2023 09:41
Run CodeQL locally to check your codebase

Install CodeQL CLI from here

codeql database create project-ql --language=javascript
codeql pack download codeql/javascript-queries
codeql database analyze project-ql codeql/javascript-queries --format=sarifv2.1.0 --output=query-results.sarif --download
sudo pip install sarif-tools
sarif html -o venteur-ql-report/summary.html query-results.sarif

Now open the summary.html in your favorite browser

sbimochan / styles.css
Created May 17, 2022 13:10
Refined Bitbucket custom styles
@import url(;
.code-diff {
font-family: 'Fira Code', monospace;
font-weight: 500;
line-height: 23px;
sbimochan /
Last active February 20, 2023 11:18
Coding assignment Javascript Full stack

Coding Assignment

Create a Restful API for CRUD application using expressJs framework and ReactJS with hooks that has following features.

  • Logged in users can create, delete and update their article.
  • Public user can read the article.

It should show the following implementation:

  • Run in multi thread of CPU.
  • Dockerize the api such that it can be run in services like fargate or kubernetes
  • API should have unit tests
sbimochan /
Last active January 16, 2023 13:36
Get All unique commits going to staging branch from dev or other

Make sure you pulled all the commits in dev and staging branch

Approriately change if needed for master and staging.

git log origin/staging..origin/dev --oneline --no-merges

Press enter and grab all the result in clipboard

Fire up the console

sbimochan / work.scpt
Last active December 31, 2021 05:14
Daily work flow automation
tell application "iTerm2"
tell current session of current tab of current window
split vertically with default profile
split vertically with default profile
write text "cd ~/projects/myFavProject"
write text "code ."
end tell
tell second session of current tab of current window
write text "cd ~/projects/myFavProject"
sbimochan /
Created April 16, 2021 15:30
Remove annoying banner from

A temporary workaround to remove the banner.

  • Fire up console. Right click-> click Inspect element-> Click console tab
  • Paste following
setInterval(()=> {
  let banner = document.getElementById('showroom');
sbimochan / autoRowOpener.js
Last active January 15, 2021 03:47
Open all rows of react-table in new tab. Change 7 to number of columns manually. You might get a pop up blocked in url box while running for first time.
function getColumnIndices(total) {
let indices = [];
//7 because number of column is 7
for (let index = 0; index < total; index += 7) {
return indices;
const allColumns = document.getElementsByClassName('rt-td');
const indices = getColumnIndices(allColumns.length);
sbimochan /
Created August 25, 2020 09:14
Faker for dummy.
pip install faker
vim ~/

Hit i

Paste these

sbimochan /
Last active April 27, 2021 06:05
Basic measures you should take to prevent Web vulnerabilities

Prevent Web Vulnerabilities

It's a shame to see all those nepal's government and ecommerce sites getting hacked. I'd like to call out all Pentesters out there that can at least share out some docs, links that could make our government systems secure. The purpose of this document to have a single source to eliminate overwhelming results from google. Security is very wide domain just like development. You should dedicate some hours to prevent from basic vulnerabilities if you follow these steps. There are already lots of tools that are making life of developers easy.

sbimochan / All profiles
Created August 21, 2019 06:58
iterm2 Profile
"Profiles": [
"Badge Text" : "",
"Working Directory" : "\/Users\/grim",
"Prompt Before Closing 2" : 2,
"Selected Text Color" : {
"Red Component" : 0.95294117647058818,
"Color Space" : "sRGB",
"Blue Component" : 0.35294117647058826,