Skip to content

Instantly share code, notes, and snippets.

# 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

diff --git a/src/CCallback.cpp b/src/CCallback.cpp
index a358b40..6ef5a12 100644
--- a/src/CCallback.cpp
+++ b/src/CCallback.cpp
@@ -13,7 +13,7 @@
CCallback *CCallback::m_Instance = new CCallback;
-void CCallback::ProcessCallbacks()
+void CCallback::ProcessCallbacks()
@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",
import string
import random
import sys
import uuid
print("""
#include <a_samp>
enum e {
a,
@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
// Example of using Incognito's streamer plugin
//
// Map: Karlip's Christmas Tree
// http://forum.sa-mp.com/showthread.php?t=58588
#include <sampgdk/a_players.h>
#include <sampgdk/a_samp.h>
#include <sampgdk/core.h>
#include <sampgdk/interop.h>
#include <sampgdk/sdk.h>