Skip to content

Instantly share code, notes, and snippets.

View rudrathegreat's full-sized avatar
🎥
Running a YouTube Channel!

Rudra Sekhri rudrathegreat

🎥
Running a YouTube Channel!
View GitHub Profile
@rudrathegreat
rudrathegreat / Sample.java
Created September 15, 2019 10:44
My first Java Program
public class Sample
{
public static void main(String[] args)
{
System.out.println("Welcome to Java");
}
}
@rudrathegreat
rudrathegreat / Sample.java
Created September 15, 2019 10:44
My first Java Program
public class Sample
{
public static void main(String[] args)
{
System.out.println("Welcome to Java");
}
}
@rudrathegreat
rudrathegreat / Article.md
Created August 28, 2019 09:52
How to be a Better Programmer

10 Coding Mistakes That Make Your Code Smell

hussein cheayto

Replicated on Github by me!

1. Redundant Comments

Don't add comments where they are not suppoed to be. For e.g. -

@rudrathegreat
rudrathegreat / Pickling.py
Created August 4, 2019 08:10
Pickling a dictionary and then unpickling it
import pickle
from random import randint
from datetime import datetime
# LINES 6-18 ARE USED TO PICKLE SOMETHING TO DISK
present = datetime.now()
data_dict = {
'voltage': randint(1,5),
'current': randint(1,5),
@rudrathegreat
rudrathegreat / MultiLEDControl.ino
Created February 17, 2019 06:10
Lighting Up LEDs with the Particle Electron
int led1 = D0;
int led2 = D3;
int led3 = D7;
int led1_status = 0;
int led2_status = 0;
int led3_status = 0;
void setup () {
pinMode(led1, OUTPUT);
@rudrathegreat
rudrathegreat / Loading.py
Last active February 15, 2024 17:07
A Simple Loading Animation For the Command Line Using Python 3
"""
This program is designed to create
and animate a simple loading animation.
"""
from sys import stdout as terminal
from time import sleep
from itertools import cycle
from threading import Thread
@rudrathegreat
rudrathegreat / AudioToSpectrogram.py
Created January 4, 2019 13:08
A program designed to record, display and save live audio as both waveform and spectrogram
'''
Copyright C RudratheGreat
This program records audio from its surroundings
displays it live on several plots showing the
spectrum and waveform of the data. It is then
processed and saved as both a spectrogram and
audio which can then be played/looked back at
for further analysis.
@rudrathegreat
rudrathegreat / Audio.py
Created January 4, 2019 08:23
Saving Audio Using NumPy and SciPy
import numpy as np
from scipy.io.wavfile import write
sps = 44100 # Samples per Second
freq = 440 # Frequency is Hz
time = 5 # Duration of the audio in seconds
amp = 0.3
# Create the Audio
@rudrathegreat
rudrathegreat / Dice-Python-3.py
Last active January 1, 2019 13:50 — forked from davidlivingrooms/test.py
Dice Program for Python 3
'''
This program is designed for the original Python 3
and not for Python 2. Check out the original program
which is designed for Python 2.
Also check out my dice program fr the BBC MicroBit
here -
https://gist.github.com/rudrathegreat/f42e1ca01c81ea9973e4653b60c16085
https://gist.github.com/rudrathegreat/ed7db24af713ae8d42444bc0816d19c6
@rudrathegreat
rudrathegreat / Snipplr-29455.py
Last active December 28, 2018 09:28 — forked from lambdamusic/Snipplr-29455.py
Random Program for the Python 3 Random Function
from random import randint
for x in range(10):
print random()
print('=============================')
z = ['ciao', 'piccolo', 'bambino', 'sono', 'qua', 'io', 'in verita']