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 / docker-screen-stuff.md
Created July 26, 2021 08:42 — forked from initcron/screen-stuff.md
screen and Docker for Mac

screen ~/Library/Containers//com.docker.docker/Data/vms/0/tty


screen -AmdS docker ~/Library/Containers//com.docker.docker/Data/vms/0/tty
screen -r docker
# enter, then disconnect with Ctrl-a d
screen -S docker -p 0 -X stuff $(printf root\\r\\n)
screen -r docker
@naqushab
naqushab / separator.py
Created May 6, 2020 11:37 — forked from jlln/separator.py
Efficiently split Pandas Dataframe cells containing lists into multiple rows, duplicating the other column's values.
def splitDataFrameList(df,target_column,separator):
''' df = dataframe to split,
target_column = the column containing the values to split
separator = the symbol used to perform the split
returns: a dataframe with each entry for the target column separated, with each element moved into a new row.
The values in the other columns are duplicated across the newly divided rows.
'''
def splitListToRows(row,row_accumulator,target_column,separator):
split_row = row[target_column].split(separator)
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
@naqushab
naqushab / README.md
Created September 8, 2018 15:42 — forked from mrkpatchaa/README.md
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@naqushab
naqushab / settings.json
Created June 25, 2018 21:54
VS Code Settings
{
"code-runner.executorMap": {
"python": "\"C:\\Users\\neyazee\\AppData\\Local\\Programs\\Python\\Python36\\python.exe\"" ,
//"python": "\"C:\\Python27\\python.exe\"",
"cpp": "cd $dir && g++ -std=c++11 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
},
"java.errors.incompleteClasspath.severity":"ignore",
"workbench.colorTheme": "One Dark Pro",
"window.zoomLevel": 0,
"C_Cpp.intelliSenseEngine": "Default",
@naqushab
naqushab / install_wsl_creators_update.bat
Created June 12, 2018 23:03 — forked from trzecieu/install_wsl_creators_update.bat
Automates process of installation and configuration of WSL
@echo off
echo - This scripts automates process of installing Windows Subsystem for Linux (WSL)
REM Due some limitations, this script has to be can't be executed under PowerShell
Get-ChildItem >nul 2>&1
if %errorLevel% == 0 (
echo # Swich to CMD
cmd /c start "" %0
exit 0
)
@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

@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 / 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 / Get Google Drive Link.js
Created January 17, 2018 10:02
Get Drive Links in a webpage