Skip to content

Instantly share code, notes, and snippets.

@cstewart90
cstewart90 / OpenWithSublimeText3.bat
Last active March 27, 2024 07:17 — forked from interisti/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 10)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@cstewart90
cstewart90 / chill_servers.rb
Last active August 23, 2016 14:14
WeeChat script to show status of #ClanChill Quake Live servers.
# Copyright (c) 2016 Christopher Stewart
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
@cstewart90
cstewart90 / factories.txt
Last active August 26, 2022 23:59
Default Quake Live Factories (formatted)
[{
"cvars": {
"timelimit": "5",
"fraglimit": "10",
"g_overtime": "0",
"g_training": "1",
"bot_dynamicSkill": "1",
"practiceflags": "0",
"bot_startingSkill": "2",
"g_allowkill": "0",
@cstewart90
cstewart90 / download_workshop.sh
Last active September 4, 2016 23:49
Downloads workshop items from workshop.txt
#!/bin/bash
# Modified version of https://github.com/tjone270/Quake-Live/blob/master/qlds-scripts/autodownload.sh
# Original created by Thomas Jones on 03/10/15.
# [email protected]
#
# Uses for loop to iterate through workshop IDs.
# Works for workshop.txt in this format https://gist.github.com/cstewart90/4fdd04c5d826ad6b039a
qldsPath="$HOME/qlds"
steamcmdPath="$HOME/steamcmd"
import minqlx
class allowkill(minqlx.Plugin):
def __init__(self):
self.add_hook("map", self.handle_map)
self.add_hook("game_start", self.handle_game_start)
self.add_hook("game_end", self.handle_game_start)
def handle_map(self, map_name, factory):
from enum import Enum
class VoteFlags(Enum):
map = 1
map_restart = 2
nextmap = 4
gametype = 8
kick = 16 # Also clientkick
timelimit = 32
fraglimit = 64
#!/usr/bin/env python3.5
"""
Deletes all "minqlx:players:*:permission" keys.
"""
import redis
r = redis.StrictRedis(unix_socket_path='/var/run/redis/redis.sock')
for key in r.scan_iter("minqlx:players:*:permission"):
@cstewart90
cstewart90 / server_monitor.py
Last active April 28, 2020 15:53
Queries local QL servers and restarts supervisor process if they are not responding
#!/usr/bin/env python3.5
from supervisor.xmlrpc import SupervisorTransport
import xmlrpc.client
import valve.source.a2s as a2s
import socket
import time
supervisor_socket = "unix:///tmp/supervisor.sock"
SERVERS = [{"port": 27960, "process": "qldf:qzeroded_qldf1", "name": "DE Race #1"},
# frozen_string_literal: true
# Copyright (c) 2016 Christopher Stewart
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Christopher Stewart <[email protected]>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the