Skip to content

Instantly share code, notes, and snippets.

View bhaskar253's full-sized avatar
🎯
Focusing

Bhaskar bhaskar253

🎯
Focusing
View GitHub Profile
@bhaskar253
bhaskar253 / links.txt
Last active March 25, 2024 05:59
DS & Algorithms Preparation Materials
@bhaskar253
bhaskar253 / vimtutor_summary.txt
Created September 13, 2023 01:16
vimtutor summary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
@bhaskar253
bhaskar253 / .vimrc
Created June 21, 2023 02:45
my vim config
" Turn on syntax highlighting
syntax on
" Set default tab space to 2
set ts=4
"set sts=4
"set sw=4
" Convert tabs to spaces
"set et
" Show line numbers
set number
@bhaskar253
bhaskar253 / m3u8-concat.sh
Created June 29, 2021 15:01 — forked from maxwellito/m3u8-concat.sh
Concat / join .ts segment files into an mp4 file
#!/bin/sh
# This script must be executed in the repo where
# the *.ts files are.
# It will concatenate the segments into one temp
# file which ffmpeg will reencode the audio track.
# By default the ouptup filename is output.mp4
# but can be changed by providing the name as parameter.
#
# ffmpeg is required
@bhaskar253
bhaskar253 / application.yml
Created March 30, 2021 19:23
Common Configuration for microservice
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka/
instance:
hostname: localhost
@bhaskar253
bhaskar253 / uuidv4.js
Created March 10, 2021 12:22
for generating unique ids
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.uuidv4=r()}}(function(){return function r(e,n,t){function o(f,u){if(!n[f]){if(!e[f]){var a="function"==typeof require&&require;if(!u&&a)return a(f,!0);if(i)return i(f,!0);var d=new Error("Cannot find module '"+f+"'");throw d.code="MODULE_NOT_FOUND",d}var p=n[f]={exports:{}};e[f][0].call(p.exports,function(r){var n=e[f][1][r];return o(n?n:r)},p,p.exports,r,e,n,t)}return n[f].exports}for(var i="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}({1:[function(r,e,n){function t(r,e){var n=e||0,t=o;return t[r[n++]]+t[r[n++]]+t[r[n++]]+t[r[n++]]+"-"+t[r[n++]]+t[r[n++]]+"-"+t[r[n++]]+t[r[n++]]+"-"+t[r[n++]]+t[r[n++]]+"-"+t[r[n++]]+t[r[n++]]+t[r[n++]]+t[r[n++]]+t[r[n++]]+t[r[n++]]}for(var o=[],i=0;i<256;++i)o[i]=(i+256).toString(16).subs
@bhaskar253
bhaskar253 / DynamicProgramming.java
Last active March 3, 2021 01:07
Basic DP problems categorized based on common Patterns mentioned in Aditya Verma's DP Youtube playlist
// DP Youtube Playlist - https://www.youtube.com/playlist?list=PL_z_8CaSLPWekqhdCPmFohncHwz8TY2Go
package dp;
import java.util.Arrays;
@SuppressWarnings("ALL")
public class DynamicProgramming {
/* Knapsack Pattern */
@bhaskar253
bhaskar253 / Change Keyboard Layout on Raspberry Pi
Created November 19, 2020 04:41
Changing Keyboard Layout on Raspberry Pi
By default, the keyboard layout is set for UK on Raspbian OS, to set it to US following are the steps:
1. Launch Terminal
2. Open “/etc/default/keyboard” with nano (or any other editor).
sudo nano /etc/default/keyboard
The file should be like this:
@bhaskar253
bhaskar253 / dummy.txt
Created August 6, 2020 15:10
How to insert, commit and fetch data using PyMySQL
import pymysql.cursors
connection = pymysql.connect(host='localhost',
user='dummy',
password='pass',
db='demo',
cursorclass=pymysql.cursors.DictCursor)
try:
with connection.cursor() as cursor:
sql = "INSERT INTO student ( roll, name ) VALUES (%s, %s)"