Skip to content

Instantly share code, notes, and snippets.

View anishshobithps's full-sized avatar
👀
Oh , I see your looking at my profile, I hope you like it!

Anish Shobith P S anishshobithps

👀
Oh , I see your looking at my profile, I hope you like it!
View GitHub Profile
@anishshobithps
anishshobithps / regex.js
Last active July 21, 2022 13:28
Some awesome regex to make your coding easier :P
module.exports = {
mentions: {
userOrMember: /^(?:<@!?)?(\d{17,19})>?$/,
channel: /^(?:<#)?(\d{17,19})>?$/,
role: /^(?:<@&)?(\d{17,19})>?$/,
snowflake: /^(\d{17,19})$/,
},
misc: {
emoji: /^(?:<a?:\w{2,32}:)?(\d{17,19})>?$/,
username: /.{2,32}/,
@anishshobithps
anishshobithps / install.ps1
Last active July 20, 2023 13:40
Installs Java for lavalink using choclately
# Copyright 2020 Anish Shobith P S.
#
# This is just a little script that can be downloaded from the internet to
# install Java on Windows Operating system with chocolatey package manager
# Function to test if the script is running with adminstrative privileges
function Administrator-Test {
$CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $CurrentUser).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
@anishshobithps
anishshobithps / index.ts
Last active January 19, 2021 15:08
Fetching content from subbreddits via using node-fetch . Implementation in typescript
/**
*@copyright 2021 Anish Shobith P S
*/
import * as fetch from 'node-fetch';
export type subRedditType = "top" | "hot" | "controversial" | "new" | "rising";
/**
* Fetchs a subreddit with a limit to 100 responses
* @param {string} subreddit - subreddit you wanna fetch.
@anishshobithps
anishshobithps / QuadraticSearch.cpp
Last active June 4, 2022 20:35
Implementation of Quadratic Search in c++
/* Implementation of Quadratic Search in c++
* Research Paper : https://research.ijcaonline.org/volume65/number14/pxc3886165.pdf
* Author : Parveen Kumar
* Code Author: Anish Shobith P S
*/
#include<bits/stdc++.h>
class QuadraticSearch
{
private:
@anishshobithps
anishshobithps / Fractional_Knapsack.java
Last active August 11, 2022 17:32
Fractional Knapsack, also sorts by (Profit / weight) Ratio.
import java.util.*;
class Item {
public double weight;
public double profit;
public double ratio;
Item(double weight, double profit) {
this.weight = weight;
this.profit = profit;
{
"types": [
{"name":"Password","regexPattern":".*password.*", "sensitive":false, "onKey": true},
{"name":"Username","regexPattern":".*username.*", "sensitive":true, "onKey": true},
{"name":"token","regexPattern":".*token.*", "sensitive":true, "onKey": true},
{"name":"secret","regexPattern":".*secret.*", "sensitive":true, "onKey": true},
{"name":"database","regexPattern":".*database.*", "sensitive":true, "onKey": true},
{"name":"db","regexPattern":".*db.*", "sensitive":true, "onKey": true}
]
}
AWSTemplateFormatVersion: 2010-09-09
Description: Create two EC2 instances, one for cron and one for mongo
Resources:
CronInstance:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
ImageId: ami-0123456789abcdef0
SecurityGroups:
- !Ref CronSecurityGroup
@anishshobithps
anishshobithps / key.pub
Created November 25, 2023 18:59
My PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEZWMBKxYJKwYBBAHaRw8BAQdAhAPsKm7gxfWJSsBaTpjV95Aosc1mODnJECGD
gZYVpoW0PEFuaXNoIFNob2JpdGggUCBTIChBU1VTLVJPRy1HMTQpIDxhbmlzaC5z
aG9iaXRoMTlAZ21haWwuY29tPoiTBBMWCgA7FiEEEwt8idxfwK+emVvx2JY2akuV
co4FAmVjASsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQ2JY2akuV
co4JnAD/VWD7yvyraMwXhie/r1XXcC4ieyetTZ1GziHDUu2HO5sA/AnJIW1S89Le
1VVdMDB0xZdKyXb+wTpmjRNSpjAS3VwHuDgEZWMBKxIKKwYBBAGXVQEFAQEHQFq3
xj49LL+2B4n4oeHPBbIlXJhDeldbzXBvnetxGmV6AwEIB4h4BBgWCgAgFiEEEwt8
idxfwK+emVvx2JY2akuVco4FAmVjASsCGwwACgkQ2JY2akuVco7GtAEA3++ccSxF