Skip to content

Instantly share code, notes, and snippets.

@Zeex
Zeex / GroupTargetSources.cmake
Last active June 3, 2021 12:00
group_target_sources(target) - group target's source files on based on their directory.
# group_target_sources(target) - group target's source files on based on
# their directory.
function(group_target_sources target)
get_target_property(sources ${target} SOURCES)
foreach(file ${sources})
get_filename_component(path "${file}" ABSOLUTE)
get_filename_component(path "${path}" PATH)
if(file MATCHES "${PROJECT_BINARY_DIR}")
file(RELATIVE_PATH path ${PROJECT_BINARY_DIR} "${path}")
@Zeex
Zeex / qlzeex.cfg
Last active November 7, 2020 15:48
Quake Live config
unbindall
model "razor/default"
// Weapon bindings
bind c "weapon 1; seta cg_drawCrosshair 7"
bind q "weapon 2; seta cg_drawCrosshair 2"
bind a "weapon 3; seta cg_drawCrosshair 4"
bind g "weapon 4; seta cg_drawCrosshair 8"
bind r "weapon 5; seta cg_drawCrosshair 7"
/*
Source for ida_patcher
Copyright (c) 2006 Chris Eagle cseagle at gmail.com
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
# Usage:
#
# docker build . -t samp
# docker run --rm --name samp -v $PWD:/samp -it samp
FROM ubuntu:bionic
RUN apt-get update -q
RUN apt-get install -y \
gcc g++ gcc-multilib g++-multilib \
@Zeex
Zeex / forgot-docker.md
Last active September 6, 2018 19:55
Just some notes for myself in case I forget how to use Docker

Forgot how to use Docker again?

Test if Docker installation is working

docker run hello-world

Run an Ubuntu container and open shell

@Zeex
Zeex / .atom-build.json
Last active January 10, 2016 09:05
Build Pawn scripts in Atom with https://atom.io/packages/build
{
"cmd": "pawncc",
"args": [
"-i$SAMP_SERVER_ROOT/plugins/crashdetect/include",
"-i$SAMP_SERVER_ROOT/plugins/jit/include",
"-i$SAMP_SERVER_ROOT/plugins/profiler/include",
"-i$SAMP_SERVER_ROOT/include",
"-i$SAMP_SERVER_ROOT/include/amx_assembly",
"-i$SAMP_SERVER_ROOT/include/YSI",
"-i$SAMP_SERVER_ROOT/include/YSI/YSI",
@Zeex
Zeex / 65k.py
Last active January 4, 2016 10:59
#!/usr/bin/env python
import sys
if len(sys.argv) > 1:
num_lines = int(sys.argv[1])
else:
num_lines = 2**16
print("""
#include <a_samp>
test1() {
new Float:a = 1.5;
a += 16;
printf("%f (%08x)", a, a);
}
test2() {
new Float:a = 1.5, b = 16;
@Zeex
Zeex / samp-env
Last active January 3, 2016 16:29
#!/bin/bash
me="$(basename "${BASH_SOURCE[0]}")"
my_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SAMP_SERVER_ROOT=$my_dir
export SAMP_SERVER=$SAMP_SERVER_ROOT/samp03svr
export SAMP_SDK_ROOT=$SAMP_SERVER_ROOT/plugins/sdk
export PATH=$PATH:$SAMP_SERVER_ROOT/cli:$SAMP_SERVER_ROOT/pawn/build/linux
@echo off
set CMAKE_HOME="%ProgramFiles%\CMake 2.8\"
if exist %CMAKE_HOME% ( goto :cmake_found )
set CMAKE_HOME="%ProgramFiles(x86)%\CMake 2.8\"
if exist %CMAKE_HOME% ( goto :cmake_found )
echo Could not find CMake
goto :exit