Skip to content

Instantly share code, notes, and snippets.

View abhinav4848's full-sized avatar
🎯
doctor

Abhinav abhinav4848

🎯
doctor
View GitHub Profile
@abhinav4848
abhinav4848 / Short Poems.md
Created January 1, 2025 21:34
A collection of short poems that I liked

Poem

"One day, when I wake up at 3 AM, unable to sleep, I will look next to me and you will be there. Sleeping peacefully beside me and suddenly, the world won't seem so lonely."

@abhinav4848
abhinav4848 / Stumbleupon_bookmarklet.js
Last active November 19, 2023 09:06
StumbleUpon's "Add to List" browser bookmarklet
javascript:void((function(d)%7Bvar e%3Dd.createElement(%27script%27)%3Be.setAttribute(%27type%27,%27text/javascript%27)%3Be.setAttribute(%27charset%27,%27UTF-8%27)%3Be.setAttribute(%27src%27,%27https://www.stumbleupon.com/bookmarkletclient/bookmarklet.js%3Fr%3D%27%2BMath.random())%3Bd.body.appendChild(e)%7D)(document))%3B
@abhinav4848
abhinav4848 / code tests.ipynb
Last active July 6, 2021 21:09
Solving problems from this YouTube video: https://www.youtube.com/watch?v=_DvSIoQKBac solved in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abhinav4848
abhinav4848 / lecturio download.js
Last active April 23, 2023 17:54
Download videos from lecturio. Read comments below
'use strict';
function copy(ele) {
let temp = document.createElement('textarea');
document.body.appendChild(temp);
temp.value = ele.replace(/:/, '-');
temp.select();
document.execCommand('copy');
temp.remove();
}
@abhinav4848
abhinav4848 / sort files into folders based on max number of files per folder.py
Last active June 4, 2021 11:53
Python code to reduce a clutter of files into set of folders each having a fixed number of files
# make sure your code file is in the base folder of "test" which contains all files to be sorted
import os
# we'll use this to increment folder count
i = 0
# set subfolder name here
workingfolder = 'test'
# move currentworkingdirectory to "test" folder
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(

Say you have http://abhinav.spsdarj.org/2017/12/how-to-redirect-base-url-addresses-to-another-base-url/ as a url on your old website (abhinav.spsdarj.org) and now you want the link to redirect to new website. Say abhinavkr.ga but the url following abhinavkr.ga should stay the same and when typing the old url, should magically redirect with rest of the link intact to the new website.

Here’s what you do. Go to the old site’s folder in your file manager, access the .htaccess and add this:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^abhinav\.spsdarj\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.abhinav\.spsdarj\.org$
RewriteRule ^(.*)$ "http\:\/\/blog\.abhinav\.ga\/$1" [R=301,L]

It isn’t all that easy to create a good mediawiki site with URL rewrite (you know… hide the “index.php” part and make it all pretty looking like “YourDomain.ext_/wiki/_“), So here I put down a step by step method of going through this cumbersome process.

  1. QuickInstall mediawiki in a directory in your public_html folder. Say, in folder “wiki“. (Now, your mediawiki installation is in “YourDomain.ext/wiki/” but yet, when you go to YourDomain.ext, you aren’t redirected to anywhere (like going to en.wikipedia.org redirects you to en.wikipedia.org/wiki/). So now,

  2. Add this to the .htaccess file in public_html to redirect your root folder link to the subfolder in which wiki is installed. (So now, when you enter YourDomain.ext, it takes you to YourDomain.ext/wiki)

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.ext$
    

RewriteRule ^(/)?$ wiki [L]

@abhinav4848
abhinav4848 / redirect one domain to another, preserving the arguments after slash.htaccess
Last active June 17, 2019 21:50
Redirect custom.spsdarj.org to abhinavkr.ga/custom
RewriteEngine on
RewriteCond %{HTTP_HOST} ^custom\.spsdarj\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.custom\.spsdarj\.org$
RewriteRule ^/?$ "http\:\/\/abhinavkr\.ga\/learn\/custom\/" [R=301,L]