Skip to content

Instantly share code, notes, and snippets.

@RJ722
RJ722 / output.txt
Created July 16, 2017 09:48
Annotation Test Output
405 class Foo:
"""Basic Python Cheat Sheet by Filip Kral on 2015/02/16"""
"""
Python is a cross-platform, interpreted, object-oriented programming language.
That means you can run it on Linux, Windows, Mac, and other platforms,
you don't need to compile your code to execute it because it is compiled on
the fly, and you can use classes and objects.
This cheat sheet summarizes the very basics of Python programming syntax.
It is by no means exhaustive! For more comprehensive yet still compact reference
@RJ722
RJ722 / output_flasky.md
Created July 16, 2017 17:17
output when vulture run on flasky (https://github.com/miguelgrinberg/flasky)
app/__init__.py:17: Unused attribute 'session_protection'
app/__init__.py:18: Unused attribute 'login_view'
app/__init__.py:35: Unused variable 'sslify'
app/api_1_0/__init__.py:5: Unused import 'authentication'
app/api_1_0/__init__.py:5: Unused import 'errors'
app/api_1_0/__init__.py:5: Unused import 'users'
app/api_1_0/authentication.py:27: Unused function 'auth_error'
app/api_1_0/authentication.py:40: Unused function 'get_token'
app/api_1_0/comments.py:8: Unused function 'get_comments'
@RJ722
RJ722 / the_very_basics_of_git.md
Last active July 21, 2017 09:17
The very basics of git.

Initialisation

Git needs to know what content does it needs to track (which directory), therefore we initialise them as a git repository by the command:

cd hello-world/
git init

It will output something like:

Initialized empty Git repository in /Users/rahuljha/Documents/hello-world/.git/
@RJ722
RJ722 / livestreamingyoutube
Created October 4, 2017 15:28 — forked from laurenarcher/livestreamingyoutube
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
@RJ722
RJ722 / .zshrc
Created November 18, 2017 15:52
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/rahuljha/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
from matplotlib import pyplot as plt
import numpy as np
import random
def random_temp_for_day(n):
i_value = random.randrange(18, 25)
return [random.randrange(i_value - 3, i_value+ 3) for _ in range(n)]

Keybase proof

I hereby claim:

  • I am RJ722 on github.
  • I am rj722 (https://keybase.io/rj722) on keybase.
  • I have a public key whose fingerprint is 1B67 094A DB30 F8E3 23AA AE56 4495 7BA5 10AA 8D8D

To claim this, I am signing this object:

@RJ722
RJ722 / IC741-OpAmp.cir
Created March 1, 2018 10:37
Simulation for IC 741 OpAmp
* Simulation of IC-741 OpAmp
* Authors: Rahul Jha, Atiya Fatima Usmani and Umamah Khan
* Biasing:
V+ 1 0 15
V- 0 4 15
* Input Sine:
Vi 8 0 AC 0.5 sin(0 0.5 1khz)
* Circuit:
Q1 7 8 9 0 Q2N3904
Q2 7 0 12 0 Q2N3904
#include <Servo.h>
Servo left_servo, right_servo;
int ESC_PIN_1 = 8;
int ESC_PIN_2 = 10;
int HIGH_SPEED = 1600;
int LOW_SPEED = 1400;
int STOP_SPEED = 1500;
import numpy as np
import matplotlib.pyplot as plt
BIT_DURATION = 1
MODULATION_FREQ = 3 / BIT_DURATION
N_SAMPLES = 10000
def generate_random_sequence(length):
return np.random.randint(0, 2, (length, ))