Skip to content

Instantly share code, notes, and snippets.

View satyaki1's full-sized avatar
:bowtie:

Satyaki Chatterjee satyaki1

:bowtie:
View GitHub Profile
@satyaki1
satyaki1 / cheatsheet.md
Created July 15, 2021 08:11
Simplified Git Cheat Sheet

Simplified Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init
@satyaki1
satyaki1 / bahasa.md
Last active March 30, 2021 09:27
Bahasa Cheat sheet
  • Kita : We
  • Pak : Sir
  • Bu : Maa'm
  • manajer produk : Product Manager
  • Pimpinan teknologi : Tech Lead
  • apa kabar : how are you
  • saya baik baik saja : I am fine
  • saya baik-baik juga: I am fine too
  • iya: yes
  • Terima kasih: thank you
@satyaki1
satyaki1 / gist:6d6f637b5eabd5522a4ce1f46bc306c1
Created December 30, 2020 07:16 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@satyaki1
satyaki1 / docker-scripts
Created August 7, 2020 10:55
Docker scripts for postgres
docker pull postgres:11.6
docker run --name [container_name] -e POSTGRES_PASSWORD=[your_password] -d postgres
docker exec -it [container_name] psql -U [postgres_user]
create database [db_name];
\c [db_name]
@satyaki1
satyaki1 / docker-compose.yml
Created August 7, 2020 10:44
Docker compose with Postgres and pgAdmin
version: "3.8"
services:
database:
image: postgres:11.6
volumes:
- qidpdata:/var/lib/postgresql/data
- ./db_scripts/:/docker-entrypoint-initdb.d
environment:
POSTGRES_USER: medium
POSTGRES_PASSWORD: medium1234
@satyaki1
satyaki1 / DockerReadMe.md
Last active August 7, 2020 10:40
docker-compose with postgresql with db init script in Windows

ReadMe for docker-entrypoint-initdb.d

  • No trailing slash in volumes
  • Always put the directory as a source

Output

database_1  | server started
database_1 | CREATE DATABASE
@satyaki1
satyaki1 / scripts.psql
Last active July 17, 2020 11:39
Postgresql manage user role and permissions. Postgresql create readonly user. Revoke create table privilege from public schema.
-- NOTE : It considers the default postgresql schema `public`, it assumes the database name to satyaki
-- Revoke privileges from 'public' role
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON DATABASE satyaki FROM PUBLIC;
-- Read-only role
CREATE ROLE readonly;
GRANT CONNECT ON DATABASE satyaki TO readonly;
GRANT USAGE ON SCHEMA public TO readonly;
@satyaki1
satyaki1 / installation_steps.md
Last active July 10, 2020 07:10
Install and Uninstall Docker in Windows WLS

Installation steps of Docker in Linux Subsystem in Windows

I'm putting the neccessary commands here only.

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

@satyaki1
satyaki1 / Jenkinsfile.groovy
Created April 7, 2020 14:48 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@satyaki1
satyaki1 / copy-by-javascript.js
Created August 1, 2019 10:04
Copy text using javascript
$('.copy-trip-id').click(function(e){
e.preventDefault();
var el = $(".trip-id-copy").data("trip-id");
$("body").append("<input id='trip-text'></input>");
$('#trip-text').attr('value', el);
var txt = $('#trip-text').select();
document.execCommand("copy");
$('#trip-text').remove();
})