Skip to content

Instantly share code, notes, and snippets.

View Nalin-Angrish's full-sized avatar
🗯️
Always learning 🤘

Nalin Angrish Nalin-Angrish

🗯️
Always learning 🤘
View GitHub Profile
import java.util.Scanner;
// The main class... put it in Employee.java only
public class Employee {
// A non-static variable is used to take a record of an object.
// So, you can create multiple instances of the Employee class
// without interfering with the variables of the other instances.
// A string variable for name.
@Nalin-Angrish
Nalin-Angrish / JavaDoc.css
Created April 16, 2021 07:27
A StyleSheet for Android JavaDoc to match the color scheme with the Jekyll Cayman Theme for GitHub pages
/* Javadoc style sheet */
/*
Overall document style
*/
@import url('resources/fonts/dejavu.css');
body {
background-color: #ffffff;
@Nalin-Angrish
Nalin-Angrish / docker_hub_github_actions.yml
Created July 9, 2021 08:54
A GitHub Actions configuration file for publishing the image to docker hub.
name: CI to Docker Hub
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
@Nalin-Angrish
Nalin-Angrish / execute.py
Created July 11, 2021 11:20
RemotePyLib examples
from RemotePyLib import Importer # Import the Importing API
importer = Importer() # Initialize an instance for exporting
importer.execModule('modulename', 'my_key')
# Replace modulename and my_key with their respective values
@Nalin-Angrish
Nalin-Angrish / generate-sitemap.py
Created July 11, 2021 11:39
SitemapGen Samples
from sitemapgen import Generator # Import the Generator class
generator = Generator(site="http://localhost", output="sitemap.xml", disguise="http://www.example.com") # Create a generator instance where:
# site = The site to generate a sitemap of. (required)
# output = The path of the output file. (required) If the sitemap is not be written to a file, just set it to an empty string.
# disguise = The url to disguise the sitemap for. (optional)
urls = generator.discover() # Discover all URLs possible from the "site" specified during initialization.
# This function returns the URLs discovered but it's return value can also be ignored if the urls don't matter
.ripple {
position: relative;
overflow: hidden;
transform: translate3d(0, 0, 0)
}
.ripple:after {
content: "";
display: block;
position: absolute;
@Nalin-Angrish
Nalin-Angrish / monte_carlo_pi.py
Created September 18, 2022 01:02
Monte Carlo method of estimating the value of pi
"""
By: Nalin Angrish
Monte Carlo method of estimating pi.
The theoretical part of this approach can be read from:
https://www.geeksforgeeks.org/estimating-value-pi-using-monte-carlo/
"""
from numpy.random import uniform
#include<Wire.h>
class GyroSensor{
private:
// MPU 6050 Register
const int MPU = 0x68;
// Error values for the accelerometer
float AccErrorX, AccErrorY;
// Time variables
float elapsedTime, currentTime, previousTime;