Skip to content

Instantly share code, notes, and snippets.

View cpxPratik's full-sized avatar

Suraj Kumar Shrestha cpxPratik

View GitHub Profile

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@cpxPratik
cpxPratik / gist:e47a866afac1d005bf9f8c05a4b7790b
Created March 7, 2022 12:14 — forked from antonrogov/gist:1216380
JavaScript Coding Guidelines

JavaScript Coding Guidelines

This is a set of coding conventions and rules for use in JavaScript programming. It is inspired by the Sun document Code Conventions for the Java Programming Language. It is heavily modified of course because JavaScript is not Java.

The long-term value of software to an organization is in direct proportion to the quality of the codebase. Over its lifetime, a program will be handled by many pairs of hands and eyes. If a program is able to clearly communicate its structure and characteristics, it is less likely that it will break when modified in the never-too-distant future.

Code conventions can help in reducing the brittleness of programs.

All of our JavaScript code is sent directly to the public. It should always be of publication quality.

@cpxPratik
cpxPratik / Dockerfile
Created July 15, 2021 08:35 — forked from Raistlfiren/Dockerfile
XDebug 3 and Docker Reference
FROM php:7.4-cli-alpine
# Install xdebug
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del .phpize-deps
WORKDIR /var/www/html
@cpxPratik
cpxPratik / phpstorm trial reset
Last active January 11, 2021 13:06 — forked from manidip/phpstorm trial reset
phpstorm trial reset
cd ~/.PhpStorm[version]
rm config/eval/PhpStorm[version].evaluation.key
rm config/options/other.xml
cd ~/.java/.userPrefs/jetbrains
rm -rf phpstorm
@cpxPratik
cpxPratik / README.md
Created July 24, 2020 12:33 — forked from brunogaspar/README.md
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@cpxPratik
cpxPratik / postgres_queries_and_commands.sql
Created July 9, 2020 14:19 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
Docker + Traefik + Let's Encrypt + Github Repository
Using:
- Ubuntu 19.04
- Docker Engine 19.03
- Docker Compose 1.25.0-rc2
- Traefik v1.7.18 with dnsChallenge
- Traefik v2.0.1 with httpChallenge
--
- Github Registry
@cpxPratik
cpxPratik / .gitlab-ci.yml
Created January 14, 2020 07:49 — forked from foklepoint/.gitlab-ci.yml
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:

I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email [email protected]

Onboarding and the workplace

https://blog.vcarl.com/interview-questions-onboarding-workplace/

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?