Skip to content

Instantly share code, notes, and snippets.

BIS_hideUnits = {
private ["_units", "_mode"];
_units = [_this, 0, objNull, [objNull, []]] call BIS_fnc_param;
_mode = [_this, 1, 0, [0]] call BIS_fnc_param; // 0 - hide (default), 1 - unhide
if (_mode == 0) then {
// Hide
{
{
private ["_unit"];
#!/usr/bin/python
import RPi.GPIO as GPIO
import os.path
import os
import click
### SETTINGS ###
PIN_NUMBER = 4
LOCKFILE = '/var/alfred.lock'
@Starfox64
Starfox64 / cl_hud.lua
Created May 14, 2016 15:19
Example HUD for GMod (with scale)
local font = "PF Ronda Seven"
surface.CreateFont( "Microblast_BarText", {
font = font,
size = 20,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = false
})
@Starfox64
Starfox64 / parseinput.py
Created November 16, 2015 10:08
Python function to request a user input while handling the input errors without having a messy code.
def parseInput(message, returnType="int", callback=None):
while True:
res = input(message)
if returnType == "int":
try:
returnVal = int(res)
except ValueError:
continue
BIS_hideUnits = {
private ["_units", "_mode"];
_units = [_this, 0, objNull, [objNull, []]] call BIS_fnc_param;
_mode = [_this, 1, 0, [0]] call BIS_fnc_param; // 0 - hide (default), 1 - unhide
if (_mode == 0) then {
// Hide
{
{
private ["_unit"];
private ["_marker"];
if (!isNil "IntelAdded") exitWith {};
_marker = createMarkerLocal ["m2", getMarkerPos "mkrM2"];
_marker setMarkerShape "ICON";
_marker setMarkerType "hd_warning";
_marker setMarkerText "Static MG";
_marker = createMarkerLocal ["range", getMarkerPos "mkrRange"];
@Starfox64
Starfox64 / htmlentities.lua
Last active March 6, 2017 11:53
Small library to process HTML entities in Garry's Mod.
--[[
Entities list by Walter Cruz.
Library by _FR_Starfox64.
]]--
htmlentities = {}
htmlentities.entities = {
[" "] = " ",
["¡"] = "¡",
hook.Add("PostDrawOpaqueRenderables", "CAH_PostDrawOpaqueRenderables", function()
for k, cahGame in pairs(CAH:GetGames()) do
local cahTable = cahGame:GetTable()
if (IsValid(cahTable) and cahTable:GetPos():DistToSqr(LocalPlayer():GetPos()) < 62500) then
local angles = cahTable:GetAngles()
angles:RotateAroundAxis(angles:Up(), 90)
cam.Start3D2D(cahTable:LocalToWorld(cahTable.origin), angles, SCALE)
local cursor = CAH:GetCursor(cahTable, angles)