Skip to content

Instantly share code, notes, and snippets.

View tushortz's full-sized avatar
❤️
One Love

Taiwo Kareem tushortz

❤️
One Love
View GitHub Profile
@tushortz
tushortz / settings.json
Created April 7, 2018 04:26
visual studio code personal settings
{
"files.autoSave": "afterDelay",
"editor.fontSize": 12,
"editor.fontFamily": "consolas, 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.wordWrap": "on",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
cd ~/Desktop
mkdir install_files
cd ~/Desktop/install_files
# install sublime text
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
@tushortz
tushortz / xsl.json
Last active July 6, 2018 12:48
visual studio code xslt snippet
{
// Place your snippets for xsl here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"xsl:apply-imports": {
"prefix": "xsl:apply-imports",
"body": [
"<xsl:apply-imports$1>"
@tushortz
tushortz / install_windows_font.ps1
Last active March 21, 2019 22:01
This installs all the fonts placed in the "Desktop/fonts" directory of any windows pc
$FONTS = 0x14;
$CurrentWorkingDirectory = Get-Location;
Write-Output "Getting fonts from path: '$CurrentWorkingDirectory'";
$ObjShell = New-Object -ComObject Shell.Application;
$ObjFolder = $ObjShell.Namespace($FONTS);
$CopyOptions = 4 + 16;
@tushortz
tushortz / mpeg_to_mp3_convert.ps1
Last active September 9, 2018 06:32
Powershell batch script to convert mpeg file to mp3
##############################
# Author: Taiwo Kareem
# 09/09/2018
# Script to convert between different audio file formats assuming ffmpeg exe is in Path environment variables
#########################
# HOW TO USE
# Create a new folder with the name of the old extension
# Place the new folder on your Desktop
# Change this next two lines for your preferred from and to format:
@tushortz
tushortz / python_members.py
Created December 9, 2018 05:58
Get all module members including signature
import inspect
import re
import importlib
def get_module_members(module, package=''):
imported = importlib.import_module(module)
module = str(module)
if package:
@tushortz
tushortz / font_installer.py
Created December 25, 2018 21:55
Python script to install multiple fonts at once on the Windows OS.
import os
import shutil
import ctypes
from ctypes import wintypes
import sys
import ntpath
try:
import winreg
except ImportError:
import _winreg as winreg
@tushortz
tushortz / git_shortcuts.sh
Last active September 13, 2019 11:07
useful git shortcuts
git config --global alias.aa "add --all"
git config --global alias.ai "add --interactive"
git config --global alias.b "branch --column"
git config --global alias.ba "branch -a"
git config --global alias.bd '!sh -c "git branch -D $@"'
git config --global alias.c "commit"
git config --global alias.ca "commit --amend"
git config --global alias.cf '!sh -c "git commit --fixup $@"'
git config --global alias.cm '!sh -c "git commit -m \"$@\""'
git config --global alias.co "checkout"
@tushortz
tushortz / parse_json_data_by_string.py
Created September 14, 2020 16:54
An attempt to parse json or python dict using just normal strings
# Author: Taiwo Kareem
# Attempt to parse dict by using string path
def str_data(paths, obj):
paths = paths.split(".")
for path in paths:
if path.isnumeric():
path = int(path)
obj = obj[path]
@tushortz
tushortz / countries_codes_and_coordinates.csv
Created April 21, 2021 06:32 — forked from tadast/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8