Skip to content

Instantly share code, notes, and snippets.

View rickysaltzer's full-sized avatar

Ricky Saltzer rickysaltzer

View GitHub Profile

First working version of the whitelist plugin. Had to modify oxmin.lua to support the passing of a plugin's context. You will need both the plugins in this gist.

Commands:

/whitelist [steamid]
/blacklist [steamid]

You must have canwhitelist and canblacklist flags (using the oxmin giveflag command) to run these commands. The steamid supplied can be either regular (i.e. STEAM_0:1:16556317) or steamid64 (i.e. 76561197993378363).

@rickysaltzer
rickysaltzer / lua_split.lua
Created January 8, 2014 16:36
Found on the internet, saving for later
-- Generic split function found on the internet
-- http://coronalabs.com/blog/2013/04/16/lua-string-magic/
function string:split( inSplitPattern, outResults )
if not outResults then
outResults = { }
end
local theStart = 1
local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
while theSplitStart do
table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) )
@rickysaltzer
rickysaltzer / steamid.lua
Last active January 2, 2016 11:09
Convert SteamID to CommunityID. Shamelessly cobbled together from various pieces on the internet.
local STEAMID = arg[1]
-- Generic split function found on the internet
-- http://coronalabs.com/blog/2013/04/16/lua-string-magic/
function string:split( inSplitPattern, outResults )
if not outResults then
outResults = { }
end
local theStart = 1
local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
@rickysaltzer
rickysaltzer / OxideWhitelistPlugin.lua
Last active January 2, 2016 08:39
Oxide Rust plugin for a server whitelist. Has not been tested, may crash.
PLUGIN.Title = "User Whitelist"
PLUGIN.Description = "Allows admin to grant access to specific users"
PLUGIN.Author = "Monstrado"
function PLUGIN:Init()
self.ServerWhitelistDataFile = datafile("server_whitelist")
self:RefreshWhitelist()
self:AddChatCommand("whitelist", self.cmdWhitelist)
self:AddChatCommand("blacklist", self.cmdBlacklist)
end
Error: call to URL https://na14.salesforce.com/services/data/v20.0/query?q=SELECT+Name%2C+Id+from+Lead+WHERE+Id+%3D+%2700Qd000000ErOKwEAN%27 failed with status 403, response [{"message":"TotalRequests Limit exceeded.","errorCode":"REQUEST_LIMIT_EXCEEDED"}], curl_error , curl_errno 0
import random
some_cards = ["9 of hearts", "10 of diamonds", "5 of clubs", "king of spades", "king of clubs", "ace of spades"]
some_other_cards = ["9 of hearts", "10 of diamonds", "5 of clubs", "king of spades", "king of clubs", "ace of spades"]
new_cards = []
fancy_cards = []
for i in range(0,len(some_cards)-1):
new_cards.append(some_cards.pop(random.randint(0,len(some_cards)-1)))
print("New Cards:")
print(new_cards)
@rickysaltzer
rickysaltzer / core.clj
Created August 8, 2012 13:32
random state and words generator
(ns honeycomb.core
(:gen-class)
(:require [clojure.string :as string]))
; Reads a file into an array (split by newline / \n)
(defn file->array
[filename]
(string/split-lines (slurp filename)))
; Some definitions of random arrays of STUFF
var Ftp = require('jsftp');
var fs = require('fs');
var user = "user";
var pass = "pass";
var dd_ftp = function(uploader) {
this.uploader = uploader;
this.ftp = new Ftp({
@rickysaltzer
rickysaltzer / redis_forum.py
Created January 3, 2012 02:50
Redis database object test, making a forum post with replies.
import redis
import json
from juggernaut import Juggernaut
r = redis.StrictRedis()
jug = Juggernaut()
def publish_reply(fn):
def wrapper(*args, **kwargs):