Skip to content

Instantly share code, notes, and snippets.

View naqushab's full-sized avatar
🏠
Working from home

Naqushab Neyazee naqushab

🏠
Working from home
View GitHub Profile
@naqushab
naqushab / Multiple Repo Deleter
Last active January 16, 2018 13:22
Delete Multiple Repos (Powershell)
get-content repolist.txt | ForEach-Object { Invoke-WebRequest -Uri https://api.github.com/repos/$_ -Method "DELETE" -Headers @{"Authorization"="token UR_TOKEN"} }
@naqushab
naqushab / ManacherAlgorithm.cpp
Created November 7, 2017 12:57
Manacher’s Algorithm
#include <bits/stdc++.h>
using namespace std;
// Transform S into T.
// For example, S = "abba", T = "^#a#b#b#a#$".
// ^ and $ signs are sentinels appended to each end to avoid bounds checking
string preProcess(string s) {
int n = s.length();
if (n == 0) return "^$";
string ret = "^";
for (int i = 0; i < n; i++)
@naqushab
naqushab / MoveOneUp.bat
Last active January 16, 2018 13:24
Move all files one up folder
for /f "delims==" %%i in ('dir /a:d /b') do for /f "delims==" %%f in ('dir %%i /a:d /b') do (move "%%i\%%f\*" "%%i"&&rd "%%i\%%f" /s /q)
@naqushab
naqushab / Recurse Move
Last active January 16, 2018 13:23
Move all files to another dir recursively
for /r "Source Folder" %x in (*.ext) do copy /y "%x" "Destination Folder"
@naqushab
naqushab / MKV To MP4
Last active January 16, 2018 13:23
convert all mkv to mp4 using ffmpeg
dir/b/s *.mkv >mkvlist.txt
for /F "delims=;" %%F in (mkvlist.txt) do ffmpeg.exe -i "%%F" -vcodec copy -acodec copy "%%~dF%%~pF%%~nF.mp4"
del mkvlist.txt
@naqushab
naqushab / Youtube Channel Ripper.sh
Created January 16, 2018 19:58
Rip Youtube Channel
youtube-dl -ciw --restrict-filenames -o "Videos/%(playlist)s/%(title)s-%(upload_date)s.%(ext)s" --download-archive archive.txt --add-metadata --write-description --write-annotation --write-thumbnail -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 --batch-file=CHANNELNAMES.txt
@naqushab
naqushab / Get Google Drive Link.js
Created January 17, 2018 10:02
Get Drive Links in a webpage
@naqushab
naqushab / CopyTextToClipboard,js
Created January 17, 2018 10:37
Copy Text to Clipboard JavaScript
function copyTextToClipboard(text) {
var textArea = document.createElement("textarea");
//
// *** This styling is an extra step which is likely not required. ***
//
// Why is it here? To ensure:
// 1. the element is able to have focus and selection.
// 2. if element was to flash render it has minimal visual impact.
// 3. less flakyness with selection and copying which **might** occur if
@naqushab
naqushab / GeeksforGeeks.css
Last active May 2, 2018 03:31
Site Cleaners
.themonic-nav ul.nav-menu,.themonic-nav div.nav-menu>ul {
background: none repeat scroll 0 0 #111111;
}
a {
color: #0000ff;
}
#menu-top>li a {
color: #ffffff
@naqushab
naqushab / wsl_setup.md
Created June 12, 2018 23:01 — forked from Voronoff/wsl_setup.md
Windows development in 2018: Setting up a coding environment using Windows Subsystems for Linux (WSL), Hyper, and Visual Studio Code (vscode) with Python.

If you're here just for the section on vscode working with Python on WSL, jump here.

Creating a modern development environment in Windows

Windows is now a development environment that can compete with Mac and Linux. Windows Subsystems for Linux lets you have an Ubuntu (or other Linux flavor) installation that works near seemlessly inside of Windows. Hyper Terminal running WSL's Bash and Visual Studio Code feel really nice to code in. These are instructions for getting set up and smoothing out most of the remaining rough edges. I've included a section on getting vscode to work well with Python and WSL, but the general pattern should be usable for any unsupported language (as of now, I believe it's only Node.js that has WSL support in vscode).

Table of Contents