Skip to content

Instantly share code, notes, and snippets.

View bhavaniravi's full-sized avatar
🎯
Focusing

Bhavani Ravi bhavaniravi

🎯
Focusing
View GitHub Profile
@bhavaniravi
bhavaniravi / airflow_local_setup.bash
Created January 17, 2023 14:31
Airflow Local setup
export AIRFLOW_HOME="$(pwd)/airflow-local"
# -p ignores if file already exists
mkdir -p "$(pwd)/airflow-local"
# Install Airflow using the constraints file
AIRFLOW_VERSION=2.4.3
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
@bhavaniravi
bhavaniravi / unfollow-twitter-topics.js
Created June 21, 2022 13:12
Unfollow twitter topics
elements = document.getElementsByClassName("r-15ysp7h");
for (let index = 0; index < elements.length; index++) {elements[index].click()}
@bhavaniravi
bhavaniravi / untweeps.js
Created November 14, 2021 23:43
Untweeps Check All
function check(ele) {
ele.checked = true;
}
x = document.getElementsByName("id");
x.forEach(element => check(ele));
@bhavaniravi
bhavaniravi / twitter-giveaway.py
Created August 31, 2021 15:48
Used this script to generate twitter giveaway based on replies
import tweepy
from dotenv import load_dotenv
import os
import logging
import time
load_dotenv()
CONSUMER_KEY = os.environ["CONSUMER_KEY"]
@bhavaniravi
bhavaniravi / gist:20fdea15201005a84b1eb675bae61cee
Created August 13, 2020 05:57
Linkedin accept invitation or unfollow
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function clickButton(classname){
accept_buttons = document.getElementsByClassName(classname)
for(i=0; i<accept_buttons.length; i++){accept_buttons[i].click(); sleep(2000);}
}
@bhavaniravi
bhavaniravi / unfollow_in_linkedin.js
Created June 28, 2020 10:46
A Script to unfollow Linkedin followers
// Linkedin Unfortunately follows every collection, once in a while I use this script to clean it up
a = document.getElementsByClassName("follows-recommendation-card__follow-btn")
b = Array.from(a)
b.forEach((x) => {
x.click()
})
@bhavaniravi
bhavaniravi / video_time.py
Created March 30, 2020 04:33
Find length of videos in a folder
from mutagen.mp4 import MP4
duration = 0
for file in os.listdir():
mp4 = MP4(file)
duration += mp4.info.length
print (duration)
@bhavaniravi
bhavaniravi / youtube_timestamp.js
Created March 25, 2020 22:16
A script to calculate timestamp of youtube playlist
ele = document.getElementsByClassName("style-scope ytd-thumbnail-overlay-time-status-renderer")
for(i=0, i<ele.length, i+=){
if (ele[i].tagName == "span"){
label = ele[i].getAttribute("aria-label")
times = parseFloat(ele[2].textContent.replace(":", ".").trim())
}
}
@bhavaniravi
bhavaniravi / react_button_cheetsheet.js
Created May 19, 2019 09:07
CheatSheet to create a Button Component in React
import React from 'react'
import styled, { css } from 'styled-components'
const Button = styled.button`
position: absolute;
height: 10%;
width: 10%;
top: 50%;
left:50%;
@bhavaniravi
bhavaniravi / App.js
Created April 20, 2019 06:44
Blog gist Integrate with frontend
import React, {Component} from 'react';
import TodoList from '../ui/TodoList';
import StateProvider from './StateProvider';
class App extends Component {
render() {
return (
<StateProvider>
<TodoList/>
</StateProvider>