Skip to content

Instantly share code, notes, and snippets.

@Zeex
Zeex / callnative.cpp
Last active December 15, 2015 06:39
CallNative()
#include <cstring>
#include <sampgdk/amx.h>
#include <sampgdk/core.h>
cell CallNative(AMX *amx, AMX_NATIVE native, int num_params) {
int params_size = num_params * sizeof(cell);
amx_Push(amx, params_size);
cell *params;
amx_GetAddr(amx, amx->stk, &params);
/* Abstract Machine for the Pawn compiler, debugger support
*
* This file contains extra definitions that are convenient for debugger
* support.
*
* Copyright (c) ITB CompuPhase, 2005-2006
*
* This software is provided "as-is", without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
@="Open PowerShell here"
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
[HKEY_CLASSES_ROOT\Directory\background\shell\powershell]
@Zeex
Zeex / OpenGitShellHere.reg
Created January 24, 2013 14:05
Open Git shell via Explorer context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\git_shell]
@="Open &Git shell here"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,5c,00,47,00,69,00,74,00,5c,00,65,00,74,00,\
63,00,5c,00,67,00,69,00,74,00,2e,00,69,00,63,00,6f,00,00,00
[HKEY_CLASSES_ROOT\Directory\shell\git_shell\command]
@="wscript \"C:\\Program Files\\Git\\Git Bash.vbs\" \"%V\""
@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"
@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 / 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 / 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 / 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 / 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)