Skip to content

Instantly share code, notes, and snippets.

View JamesxX's full-sized avatar

James R Swift JamesxX

  • 05:54 (UTC +01:00)
View GitHub Profile
% Defines a macro for showing mass spectra
\usepackage{options}
\usepackage{environ}
\usepackage{pgfmath}
\usepackage{pgfplotstable}
\options{
/MassSpectrum/.new family,
/MassSpectrum/dim/width/.new length = 0.9\textwidth,
/MassSpectrum/dim/height/.new length = 8cm,
public abstract class UntypedVariable{
public abstract object ValueUntyped { get; }
}
public class UntypedVariable<T> : UntypedVariable {
private T Value;
public override object ValueUntyped{ get { return Value; } }
public UntypedVariable( T New ){
@JamesxX
JamesxX / Command.cs
Last active September 11, 2017 15:16
ChatLibrary for S&box
using System;
using System.Collections.Generic;
namespace ChatLibrary
{
public static class Command
{
public delegate void Callback(List<string> arguments);
private static Dictionary<string, Callback> Commands = new Dictionary<string, Callback>();
@JamesxX
JamesxX / PromisedFunctions.lua
Created February 11, 2017 15:10
Promise functions to native libraries, that can be redefined at any point
--[[
Virtual functions - Lua
]]
local vfunc = { }
function PromiseVirtualFunction( sFunctionName )
return function( ... )
if (vfunc[sFunctionName]) return vfunc[sFunctionName]( ... ) end
error( string.format( "Promised function %s was nil", sFunctionName ) )
#include "library.cpp"
#include <iostream>
int main() {
std::cout << "Start of program" << std::endl;
typedef int(*myfunc)(int);
JLib::Library MyLibrary("xyz");
local PRE = 1
local TEST = 2
local GREY = Color(200,200,200)
local PASS = Color(150,200,000)
local FAIL = Color(200,000,000)
local threads_to_reboot = { }
@JamesxX
JamesxX / gist:63d9c47e4e47b0d3b6f7
Last active August 29, 2015 14:24
Spray Loader
--[[
SprayLoader - Load images from websites
]]
SprayLoader = {};
SprayLoader.Cache = {};
SprayLoader.WaitingList = {};
SprayLoader.Panels = {};
SprayLoader.LoadURL = "localhost/solarpower/index.php?p=image&s=";
@JamesxX
JamesxX / CameraControler.lua
Created June 4, 2015 02:08
Unfinished CameraControler library
if ( CLIENT ) then
if ( CameraControler ) then return end
CameraControler = {}
CameraControler.Cameras = {}
CameraControler.Selected = 0
function CameraControler.SelectCamera( cameraID )
if ( CameraControler.CameraExists( cameraID ) ) then
@JamesxX
JamesxX / rss.class.php
Last active August 29, 2015 14:22
A simple PHP class for generating simple RSS feeds.
<?php
abstract class RSSGenerator{
/** The RSS Feed information */
protected $title;
protected $link;
protected $description;
protected $language;