- If you haven't already done so, install Eclipse. You can do this from your * nix repositories, or from [the Eclipse download page][eclipse-download]. The Scala IDE for Eclipse claims that either Eclipse IDE for Java Developers or Eclipse Classic will suffice.
- Install the Scala distribution. Once again, if possible grab this from your repositories, if not then from [the Scala download page][scala-download]. I'd recommend the IzPack installer; it seems to work on all systems I've used it on.
- Install the Scala IDE for Eclipse. Head to [the Scala IDE for Eclipse download page][scala-ide-download] and follow the instructions to install it for Scala 2.9.x.
- Download and extract CSO. Head to [Bernard Sufrin's CSO files][cso-download] and download
cso.jar
, andcso-sources-scala2.9.0.tgz
. Choose somewhere to put them - if you're root and on * nix,/usr/share/java
is a good place. Putcso.jar
in there, and extract thesrc/
folder from the sou
There are several different Socket APIs for Garry's Mod. They all have slightly different APIs, and for many of them it's unclear if they work at all in Garry's Mod 13.
LuaSocket is 'the original' socket API for Lua. It has a very simple API that closely matches the POSIX sockets API, plus some goodies thrown in (e.g. HTTP layer, MIME type handling).
While LuaSocket doesn't support Garry's Mod, it probably wouldn't be hard to create a Garry's Mod fork of it. This has the advantages of having a high-quality library and universally-recognised API, but it would involve maintenance of a binary module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a zkbd compatible hash; | |
# to add other keys to this hash, see: man 5 terminfo | |
typeset -A key | |
key[Home]=${terminfo[khome]} | |
key[End]=${terminfo[kend]} | |
key[Insert]=${terminfo[kich1]} | |
key[Delete]=${terminfo[kdch1]} | |
key[Up]=${terminfo[kcuu1]} | |
key[Down]=${terminfo[kcud1]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- prelude.lua - simple implementation of Garry's Mod Lua functionality | |
-- | |
function AddCSLuaFile() end | |
function Vector() end | |
function Angle() end | |
function loadfile(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e # terminate on any error | |
[ -f p4v.tgz ] || wget http://www.perforce.com/downloads/perforce/r14.3/bin.linux26x86_64/p4v.tgz | |
mkdir -p opt && tar xf p4v.tgz -C opt | |
mkdir -p usr/bin | |
for f in p4admin p4merge p4v p4vc; do | |
[ -x "usr/bin/$f" ] || ln -s "../../opt/p4v-2014.3.1007540/bin/$f" "usr/bin/$f" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
start=$(pwd) | |
while read line; do | |
dirname=$(dirname "$line") | |
basename=$(basename "$line") | |
cd "$dirname" | |
lowercase=$(echo "$basename" | tr '[A-Z]' '[a-z]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void GLMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void*) | |
{ | |
std::cout << message << std::endl; | |
} | |
static void SetupMessageCallback { | |
if (!ogl_ext_KHR_debug) return; | |
glDebugMessageCallback(GLMessageCallback, nullptr); | |
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); | |
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package glslplugin.lang.scanner; | |
import com.intellij.lang.ForeignLeafType; | |
import com.intellij.lang.TokenWrapper; | |
import com.intellij.lexer.Lexer; | |
import com.intellij.lexer.LookAheadLexer; | |
import com.intellij.psi.tree.IElementType; | |
import com.intellij.util.containers.ImmutableUserMap; | |
import org.jetbrains.annotations.NotNull; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char** argv) { | |
string s("ab"); | |
{ | |
istringstream stream(s); | |
stream.ignore(1); stream.ignore(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import re | |
import subprocess | |
import SCons.Action | |
from SCons.Tool import cc | |
def detect_version(env, clang): | |
clang = env.subst(clang) | |
if not clang: |
OlderNewer