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 / scopes.txt
Last active September 8, 2015 12:02 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
Actionscript: source.actionscript, source.actionscript.2
Active4D: source.active4d
Active4D_Html: text.html.strict.active4d
Active4D_Ini: text.active4d-ini
Active4D_Library: source.active4d.library
Ada: source.ada
Antlr: source.antlr
Apache: source.apache-config
{
"cmd": ["sqlite3 < $file_base_name"],
"selector": "source.sql",
"shell": true,
"variants":
[
{
"name": "With .sql",
"cmd": ["sqlite3 < $file"]
@tushortz
tushortz / json2csv.py
Created December 2, 2016 17:43 — forked from mwarkentin/json2csv.py
Convert a JSON datadump of a Django model into CSV format. Note: This only exports the fields dict, so you won't have pk in the output.
# -*- coding: utf-8 -*-
import codecs
import cStringIO
import csv
import json
import sys
"""
Convert Django json datadump fields into csv.
@tushortz
tushortz / sphinx.sublime-build
Last active April 8, 2017 16:37
Sphinx Sublime build
To create a Sphinx sublime build, open Sublime, Go to Tools --> Bulid system --> New build system and type in the following code.
I have only tried it on windows so far and it worked.
Make sure you have sphinx installed and change the path to the script. may be python27 instead of python34
{
"cmd": ["c:/Python34/Scripts/sphinx-build.exe", "-b", "html", "$filedir", "_build/html"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "text.restructuredtext"
}
@tushortz
tushortz / LoginDlg.wxs
Last active April 26, 2017 14:22
Custom Login dialog for WIX Toolset. Make sure you include a <UIRef Id="CustomUI_Login" /> in your Product.wxs file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="CustomUI_Login">
<Dialog Id="LoginDlg" Title="!(loc.InstallDirDlg_Title)" Width="370" Height="270" NoMinimize="no">
<Control Id="NameLabel" Type="Text" X="75" Y="113" Width="100" Height="15" TabSkip="no" Text="&amp;User Name:" />
<Control Id="NameEdit" Type="Edit" X="75" Y="125" Width="220" Height="18" Property="LogonUser" Text="{80}" />
<Control Id="PasswordLabel" Type="Text" X="75" Y="150" Width="100" Height="15" TabSkip="no" Text="&amp;Password:" />
<Control Id="PasswordEdit" Type="Edit" X="75" Y="162" Width="220" Height="18" Property="PASSWORD" Password="yes" />
@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 / 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: