Skip to content

Instantly share code, notes, and snippets.

View Bhupesh-V's full-sized avatar
🤔
Do I know what I am doing? No

Bhupesh Varshney Bhupesh-V

🤔
Do I know what I am doing? No
View GitHub Profile

Follow below steps to use a Google Form as a Feedback Form ;)

  1. Make a Google form having exactly the same fields as on your website.
  2. Once you do this , generate a link of the prefilled form , you will get the option by clicking onn the 3 dots
  3. The Generated URL may look somewhat like this
<!--
https://docs.google.com/forms/d/e/1FAIpQLSfim3RiM1NLrTszkwOv2uJ8mFMfZR6WZU-qKK6oRUlgA9vjuw/viewform?usp=pp_url&entry.389706550=Karma&entry.1867581834=Bitch&entry.973008035=Hellllllllooooo
-->
#!/usr/bin/env python
''' Simple script to auto-generate the README.md file for a til project.
NOTE: Someone who wanted to be fancy would actually use a template engine
for this, but this seemed like a task for which it is best to only require
python. This is not a general purpose script, but tailored for the format
being used for "Today I Learned" repos.
Apply as a git hook by running the following command in linux:
cd .git/hooks/ && ln -s ../../createReadme.py pre-commit && cd -
'''
from __future__ import print_function
# Demo Scheduler Program
import schedule
import time
def job():
print("Today is " + day + " and time is " + t)
day = str(input("Enter Day(sunday/monday etc) : "))
t = str(input("Enter Time (hh:mm) : "))

C++ Alternatives to Python

  1. startswith()
std::string s = "tititoto";
if (s.rfind("titi", 0) == 0) {
  // s starts with prefix
}
@Bhupesh-V
Bhupesh-V / scd.sh
Created August 13, 2020 09:32
smart cd - Change directories smartly [v2]
scd() {
# [s]mart cd : find absolute paths & automatically switch to them
if [[ $1 != "" ]]; then
case $1 in
[".."]* ) cd .. || exit;;
["-"]* ) cd - || exit;;
["/"]* ) cd / || exit;;
* ) while read -r value; do
files+=($value)
@Bhupesh-V
Bhupesh-V / scd-completions.bash
Last active August 17, 2020 14:18
scd : switch directories from anywhere to anywhere
#!/usr/bin/env bash
# How to use:
#
# 1. Start a new bash session
# 2. source the completions script "source scd-completions.bash" or Copy the script in /etc/bash_completion.d/
# for automatic loading
# 3. scd <search-string>[TAB][TAB]
#
#!/usr/bin/env python3
import os
import re
import urllib.request
from pkg_resources import parse_version
HEADERS = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36",
"cache-control": "no-cache",
@Bhupesh-V
Bhupesh-V / help.md
Last active March 17, 2021 06:42
Generate a RSS Feed of Recent files in a git repository

Generate a RSS Feed of Recent files in a git repository

Please read here to understand how the feed is generated

@Bhupesh-V
Bhupesh-V / README.md
Last active March 28, 2021 07:53
Replacing gitmoji-cli with FZF

Please read here on how to use this CSV file with FZF. The original emoji data has been taken from gitmoji-cli

Note: 2 character width emoji ⬆️ has been replaced with ⏫️

The following python code was used to convert gitmojis.json to CSV

#!/usr/bin/env python3

import json, csv
@Bhupesh-V
Bhupesh-V / _highlights.scss
Last active May 17, 2021 05:54
jekyll-now Code Monokai Theme. Just copy paste the following code under _sass directory in _highlights.scss file
pre.highlight {
background-color: #282923;
padding: 7px 7px 7px 10px;
border: 20px solid yellowgreen;
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1);
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1);
box-shadow: 3px 3px rgba(0,0,0,0.1);
margin: 20px 0 20px 0;
overflow: auto;