Skip to content

Instantly share code, notes, and snippets.

@satheesh-chandran
satheesh-chandran / AdbCommands.sh
Last active October 14, 2021 10:03 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@satheesh-chandran
satheesh-chandran / read.js
Created October 7, 2020 04:38
read multiple using event listener
const { EventEmitter } = require('events');
const { readFileSync } = require('fs');
const displayMultiple = (number, factor) =>
console.log(`${number} is a multiple of ${factor}`);
const readMultiple = function () {
const [, , fileName, factor] = process.argv;
const numbers = readFileSync(fileName, 'utf8').split('\n').map(Number);
echo "satheesh"
source ~/bin/alias.sh
alias grep="grep --color=always"
export PS1="\h\[\e[32m\]\u\[\e[m\]\[\e[32m\]\\$\[\e[m\]\[\e[32m\]\W\[\e[m\] "
const fs = require('fs');
const makeObject = function(string,suffix){
suffix[string.slice(-4)] = string;
return suffix;
};
const matchContents = function(firstTexts,secondTexts){
const suffix = {}
const matchedArray = [];
@satheesh-chandran
satheesh-chandran / main.c
Created June 4, 2020 09:04
A binary search tree implementation on C using Void pointer, which includes operations such as insertion, search, deletion
#include <stdio.h>
#include <stdlib.h>
#include "tree.h"
Bool is_greater(Element data1, Element data2)
{
return *(int *)data1 > *(int *)data2 ? True : False;
}
Bool is_equal(Element data1, Element data2)
@satheesh-chandran
satheesh-chandran / main.c
Last active June 10, 2020 04:09
A binary search tree implementation in C, which includes operations like insertion, search and deletion
#include "tree.h"
#include <stdio.h>
int main(void)
{
int numbers[] = {5, 3, 8, 1, 4, 7, 9, 2, 12, 17, 13, 19};
int length = sizeof(numbers) / sizeof(int);
Node_ptr tree = NULL;
for (int index = 0; index < length; index++)
{
@satheesh-chandran
satheesh-chandran / array.c
Last active May 11, 2020 10:42
Map, Filter and Reduce using function pointers in c
#include <stdlib.h>
#include "array.h"
Array* copy_array(int numbers[], int length)
{
Array* array_copy = malloc(sizeof(Array));
array_copy->array = malloc(length * sizeof(int));
for (int index = 0; index < length; index++)
{
array_copy->array[index] = numbers[index];
@satheesh-chandran
satheesh-chandran / list.c
Created April 25, 2020 09:02
Program for accessing user input and searching the positions of the entered position using linked list in C
#include <stdio.h>
#include <stdlib.h>
#include "list.h"
NODE* create_node(int value)
{
NODE *node = malloc(sizeof(NODE));
node->value = value;
node->next = NULL;
return node;
@satheesh-chandran
satheesh-chandran / main.c
Last active April 23, 2020 10:39
Program to separate the numbers between a range from a list of numbers
#include <stdio.h>
#include <stdlib.h>
#include "seperation.h"
int main(void)
{
int numbers[] = {3, 1, 7, 4, 6, 5, 8, 2};
int start_limit = 4, end_limit = 7;
int size = sizeof(numbers) / sizeof(int);
TWO_DIMENSIONAL_ARRAY *result = separate(numbers, size, start_limit, end_limit);
#include <stdio.h>
#include <string.h>
#include "split.h"
int main(void)
{
char string[20] = "my name is satheesh";
SPLIT_RESULT splited_result = split(string, ' ');
print_split_array(splited_result);
return 0;