Skip to content

Instantly share code, notes, and snippets.

View AbigailBuccaneer's full-sized avatar

AbigailBuccaneer AbigailBuccaneer

View GitHub Profile
@AbigailBuccaneer
AbigailBuccaneer / gist:1704860
Created January 30, 2012 15:02
Using CSO in an Eclipse project

Using CSO in an Eclipse project

  1. 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.
  2. 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.
  3. 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.
  4. Download and extract CSO. Head to [Bernard Sufrin's CSO files][cso-download] and download cso.jar, and cso-sources-scala2.9.0.tgz. Choose somewhere to put them - if you're root and on * nix, /usr/share/java is a good place. Put cso.jar in there, and extract the src/ folder from the sou
@AbigailBuccaneer
AbigailBuccaneer / gist:5943024
Last active March 14, 2019 14:58
State of Socket APIs for Garry's Mod 13

Socket APIs for Garry's Mod 13

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][]

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.

@AbigailBuccaneer
AbigailBuccaneer / bindkeys.zsh
Created October 3, 2014 13:10
zsh bindkeys using terminfo
# 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]}
@AbigailBuccaneer
AbigailBuccaneer / prelude.lua
Created January 25, 2015 02:41
Run Garry's Mod Lua code outside of Garry's Mod
--
-- prelude.lua - simple implementation of Garry's Mod Lua functionality
--
function AddCSLuaFile() end
function Vector() end
function Angle() end
function loadfile(filename)
@AbigailBuccaneer
AbigailBuccaneer / make.sh
Created March 20, 2015 17:46
Create a Debian package for p4v
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
#!/bin/sh
start=$(pwd)
while read line; do
dirname=$(dirname "$line")
basename=$(basename "$line")
cd "$dirname"
lowercase=$(echo "$basename" | tr '[A-Z]' '[a-z]')
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);
@AbigailBuccaneer
AbigailBuccaneer / PreprocessingLexer.java
Created July 12, 2015 18:48
PreprocessingLexer.java
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;
@AbigailBuccaneer
AbigailBuccaneer / test.cc
Last active November 18, 2015 17:02
std::istream::ignore is inconsistent with regards to eof()
#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);
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: