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 / 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 / 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
@tushortz
tushortz / Java.sublime-build
Last active February 14, 2023 05:11
Java, JavaDoc, JAR build System for Sublime text (Linux) including Wordcount and File list support.
{
"cmd": ["javac '$realpath$file' && java $file_base_name && rm *.class"],
"selector": "source.java",
"shell": true,
"variants": [
{
"name": "JavaDoc",
"cmd": ["mkdir documentation && javadoc -d documentation *.java"]
},
@tushortz
tushortz / Qt.sublime-build
Last active March 23, 2021 23:13
Qt Build System for Sublime text on Linux
{
"cmd": ["qmake -project && subl *.pro"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.cpp",
"shell": true,
"variants": [
{
{
"cmd": ["sqlite3 < $file_base_name"],
"selector": "source.sql",
"shell": true,
"variants":
[
{
"name": "With .sql",
"cmd": ["sqlite3 < $file"]
@tushortz
tushortz / Port service
Last active March 4, 2024 09:09
A list of python port services and their service numbers
1: tcpmux
7: echo
9: discard
11: systat
13: daytime
15: netstat
17: qotd
18: msp
19: chargen
20: ftp-data
@tushortz
tushortz / UNICODE to ASCII python replace
Created April 6, 2016 22:14
Function to replace some annoying characters
def unicodetoascii(text):
TEXT = (text.
replace('\\xe2\\x80\\x99', "'").
replace('\\xc3\\xa9', 'e').
replace('\\xe2\\x80\\x90', '-').
replace('\\xe2\\x80\\x91', '-').
replace('\\xe2\\x80\\x92', '-').
replace('\\xe2\\x80\\x93', '-').
replace('\\xe2\\x80\\x94', '-').
@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 / 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" />
from selenium import webdriver
from selenium.webdriver.chrome.options import DesiredCapabilities
from selenium.webdriver.common.proxy import Proxy, ProxyType
import time
co = webdriver.ChromeOptions()
co.add_argument("log-level=3")
co.add_argument("--headless")