Skip to content

Instantly share code, notes, and snippets.

View sarojbelbase's full-sized avatar
💻
alias yeet 'rm -rf'

Saroj Belbase sarojbelbase

💻
alias yeet 'rm -rf'
View GitHub Profile
@sarojbelbase
sarojbelbase / figma.sh
Created June 6, 2020 08:09
A shell script to generate desktop file, launcher, mimetypes icons, .fig file-association for figma-linux.AppImage
#!/bin/bash
# This shell script works for the appimage file downloaded from https://github.com/Figma-Linux/figma-linux/releases
# The latest release is 0.62 & it's unofficial till date.
# To run this script you must add this figma.sh in same folder or next to each other. Otherwise it won't work.
# Setup:
# 1. >>> sudo bash figma.sh (Needs root access to update mime & icon database)
# 2. >>> Right click on figma-linux.AppImage & click on Run
set -e
@sarojbelbase
sarojbelbase / youtube.sh
Last active June 12, 2020 18:52
A bash script that downloads youtube videos from 1080p to 4K, 320kbps audio mp3 & even any playlist both in audio & video version.
#!/bin/bash
# This bash script downloads youtube videos, playlists from 4K to 1080p & even extracts to mp3 using youtube-dl.
# This script also depends on 'ffmpeg' or 'avconv' so either of them needs to be installed.
# To run this script:
# 1. Simply download this gist and save it as youtube.sh
# 2. In bash type "bash youtube.sh" without inverted comma
function main_menu() {
clear
@sarojbelbase
sarojbelbase / unfollow-me.py
Last active June 30, 2020 09:16
A twitter script to remove/block all those non-mutual followers who live in your 'followers' tab.
from time import sleep
import tweepy
__author__ = 'sidbelbase'
'''
This script removes all the uncommon followers from your twitter account by blocking them one by one and
then again unblocking them, like we usually do. To make things more clearer, it only removes those accounts
which you aren't following, but those accounts who you haven't shared that magic spark till this moment. This
script is super useful when you don't want to get followed by useless bots, non-active users & don't know maybe
@sarojbelbase
sarojbelbase / choropleth-nepal.vue
Last active July 13, 2020 08:36
choropleth version of Nepal's map using covid-19 cases as a layer using vuejs
<!-- Working example of this gist is found here : https://codesandbox.io/s/choropleth-nepal-y5imk -->
<!-- This standalone script is a choropleth implementation of nepali map using vuejs framework -->
<!-- This script has these dependencies: vue-choropleth, vue2-leaflet & axios -->
<!-- To run this vue script you need to install these dependencies using npm as described below: -->
<!-- npm install vue-choropleth vue2-leaflet axios -->
<!-- With that spin up your http server to serve this standalone map. -->
<!-- You also need to download or use nepal.json to work correctly -->
<!-- There's another file along with this gist package-lock.json which gives you the idea about dependecies nothing more than that, it's for Read-Only purpose -->
<!-- To run or test this vue file independently / standalone you could also run "vue serve choropleth-nepal.vue" for this to work you need to install a global package which will be guided by npm -->
@sarojbelbase
sarojbelbase / vscode-url-handler.desktop
Last active October 11, 2020 11:29
Visual Studio Code's desktop files
[Desktop Entry]
Name=Visual Studio Code - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/opt/vscode/bin/code --no-sandbox --open-url %U
Icon=vscode
Type=Application
NoDisplay=true
StartupNotify=true
Categories=Utility;TextEditor;Development;IDE;
@sarojbelbase
sarojbelbase / models.py
Last active October 28, 2020 06:13
Pure SQLAlchemy Configuration with ORM Models
# Pure SQLAlchemy Configuration for Flask_SQLAlchemy like functioning
from os import environ
from dotenv import find_dotenv, load_dotenv
from sqlalchemy import Column, DateTime, Integer, String, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session
from datetime import datetime
load_dotenv(find_dotenv())
@sarojbelbase
sarojbelbase / fetch_tweets.py
Created October 28, 2020 05:44
Get recent tweets from a desired account with images and saves them as csv or json
# Possible due to https://gist.github.com/yanofsky/5436496
import csv
import json
import re
import pytz
import tweepy
def those_tweets(screen_name=TWEETARATI):
@sarojbelbase
sarojbelbase / index.html
Last active October 29, 2020 05:21
Default webpack/vue index template in public folder
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
@sarojbelbase
sarojbelbase / fetchMyGithubRepo.vue
Last active October 30, 2020 10:02
VueJs : Vue3 | Composition API | Github Repository | Axios | Dayjs
<template>
<section class="resume-content p-3 p-lg-5 d-flex justify-content-center" id="projects">
<div class="w-100">
<h2 class="mb-5 text-darker">Projects</h2>
<div
class="resume-item d-flex flex-column flex-md-row justify-content-between mb-5"
v-for="(repo, index) in projects"
:key="index"
>
<div class="resume-content">
@sarojbelbase
sarojbelbase / reactiveVsRefs.js
Last active October 31, 2020 15:37
Vue3 Composition API > Example > refs vs reactive
// Taken from https://medium.com/swlh/vue3-using-ref-or-reactive-88d47c8f6944
// ##001 : import from vue3:
// - reactive for making properties reactive;
// - computed for computed function like total
// - toRefs for destructuring object for template
import { reactive, computed, toRefs } from "vue";
export default {
name: 'RollTheDiceReactive',
// ##002 : implement setup function