Skip to content

Instantly share code, notes, and snippets.

View djassie's full-sized avatar

Susobhan Das djassie

View GitHub Profile
@djassie
djassie / salary.py
Created June 8, 2024 11:44
Total Salary Earned by a West Bengal Gove Employee
yearly_salary = 660000
# This salary is taken into account of a BDO - oficer
# This is calculate total salary earned by a Govt Employee in West Bengal (55000 per month in hand), with 4% increment yearly - 35 years service
# most optimistic salary saved is 60% - to average optimistic 45%
years = 0
total_salary_earned = yearly_salary
total_salary_earned_in_cr = total_salary_earned/10000000
total_salary_saved_in_cr = total_salary_earned_in_cr * 0.45
monthly_salary = yearly_salary/12
@djassie
djassie / binary_search.c
Created March 30, 2024 00:33
Binary Search : number of negatives in sorted matrix in C
int rowNegatives(int *arr, int size){
int li = 0, ri = size - 1, negative=0;
//corner cases
if(*(arr+size-1) >=0){return 0;}
if(*arr<0){return size;}
while(li<=ri){
int mid = li + (ri - li)/2;
if(*(arr+mid)<0 && *(arr+mid-1)>=0){
return size - mid;
@djassie
djassie / depth-first-search.c
Created March 18, 2024 12:15
Depth First search in C C++/Java Style
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node node;
struct node {
int data;
node *next;
};
@djassie
djassie / drupal_hackedgit.md
Created December 25, 2021 16:57 — forked from derhasi/drupal_hackedgit.md
Script to get a diff of a Drupal dev project from git and write the diff to the projects folder: `bash check_hacked.sh $PROJECTNAME`.

Check hacked status from git

This small script provides some code to check a project of your installation (located in .../www) against the associated git commit on drupal.org.

Notice: currently the root path and temp directory are hardcoded.

Examples

Check status of views module.