Skip to content

Instantly share code, notes, and snippets.

project(gamemode)
cmake_minimum_required(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
include(AmxConfig)
include(SampPlugin)
find_package(SampGdk3 REQUIRED)
include_directories(${SampGdk3_INCLUDE_DIRS})
module rdtsc;
import std.stdio;
import std.stdint;
int64_t ReadTimeStampCounter() {
version (X86_64) {
asm {
naked;
rdtsc;
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
@Zeex
Zeex / untag.sh
Created November 28, 2012 14:57
Shell script that deletes all Git tags
#!/bin/sh
me=`basename $0`
if [ $# -ne 1 ]
then
echo Usage: $me remote
exit 1
fi
@Zeex
Zeex / retag.py
Created November 28, 2012 14:58
Recover Git tags from commit messages
#!/usr/bin/env python3
import subprocess
command = 'git log --oneline | grep "^[0-9a-f]\{1,7\} v[0-9\.]*$"'
output = subprocess.check_output(command, shell=True).decode('utf-8')
for line in output.splitlines():
commit, tag = line.split()
subprocess.call('git tag -a %s -m %s %s' % (tag, tag, commit), shell=True)
@Zeex
Zeex / samp-gdb
Last active December 10, 2015 06:48
gdb wrapper for QtCreator
#!/bin/sh
samp-server-cli --output --timestamp --query --rcon --rcon-password debug \
--plugin $SAMP_GDB_PLUGIN \
--gamemode $SAMP_GDB_GAMEMODE \
$SAMP_GDB_EXTRA_OPTIONS \
--debug $*
@Zeex
Zeex / pawn.properties
Last active December 10, 2015 20:08
Pawn syntax for SciTE
# SciTE settings for the Pawn language
file.patterns.pawn=*.pwn;*.inc
filter.pawn=Pawn (pwn inc)|$(file.patterns.pawn)|
lexer.$(file.patterns.pawn)=cpp
keywords.$(file.patterns.pawn)=assert break case char const continue \
default do else enum exit false for forward goto if native new operator \
@Zeex
Zeex / SciTEUser.properties
Last active December 10, 2015 20:08
SciTE config
# Maximize the window on program startup
position.maximize=1
# Do not minimize to tray
minimize.to.tray=0
# Do not place output pane at the right (shows it at the bottom instead)
split.vertical=0
# Enable edit window's horizontal scrollbar
horizontal.scrollbar=1
# Output pane settings
@Zeex
Zeex / OpenCommandPromptHere.reg
Created January 24, 2013 14:02
Open Windows command prompt via Explorer context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\cmd_shell]
@="Open command prompt here"
"Icon"=hex(2):63,00,6d,00,64,00,2e,00,65,00,78,00,65,00,00,00
[HKEY_CLASSES_ROOT\Directory\shell\cmd_shell\command]
@="cmd.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd_shell]
@Zeex
Zeex / OpenCygwinShellHere.reg
Created January 24, 2013 14:03
Open Cygwin shell via Explorer context menu
; You will also have to edit C:\cygwin\Cygwin.bat and append %* to the bash command line
; in order to make the shell open in current directory rather than $HOME.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\cygwin_shell]
"Icon"=hex(2):43,00,3a,00,5c,00,63,00,79,00,67,00,77,00,69,00,6e,00,5c,00,43,\
00,79,00,67,00,77,00,69,00,6e,00,2e,00,69,00,63,00,6f,00,00,00
@="Open &Cygwin shell here"