Skip to content

Instantly share code, notes, and snippets.

View Kruithne's full-sized avatar
🚀
Go as far as you can take it

Kruithne Kruithne

🚀
Go as far as you can take it
View GitHub Profile
public static List<Map<String, Object>> serializeItemList(List<ConfigurationSerializable> list)
{
List<Map<String, Object>> map = new ArrayList<Map<String, Object>>();
for (ConfigurationSerializable configurationSerializable : list)
map.add(serialize(configurationSerializable));
return map;
}
public static Map<String, Object> serialize(ConfigurationSerializable configurationSerializable)
@Kruithne
Kruithne / gist:6001759
Created July 15, 2013 17:26
A simple static database wrapper using PDO in PHP.
<?php
class DB
{
/**
* @return PDO
*/
private static function getDB()
{
// The DATABASE_ constants here should be defined somewhere accessible to this wrapper.
if (self::$connection === null)
a_a = {
lapseTick = 7000,
ticks = 0,
currentChannel = nil
};
function a_a.worker(frame, elapsed)
local self = a_a;
if self.ticks == self.lapseTick then
self.broadcast();
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
@Kruithne
Kruithne / Fun!
Last active December 30, 2015 03:29
Some fun!
<html>
<head>
<title>Wobble Test</title>
<style>
#frame
{
width: 500px;
height: 500px;
background: gray;
border: 1px solid black;
@Kruithne
Kruithne / RPD!
Created December 3, 2013 21:04
RP Detector
/run local m=function(f,e,p,m,c,s) if p=='MSP'or p=='MSP?' then ChatFrame1:AddMessage(s);end end local a=CreateFrame('frame');a:SetScript("OnEvent", m);a:RegisterEvent("CHAT_MSG_ADDON");
local world = "spawn";
local x = 9909;
local y = 62;
local function hasLeafTouching(block)
local check = Location(world, block.x + 1, block.y, block.z);
if check:getBlock() == 18 then
return true;
end
@Kruithne
Kruithne / Jenkins Promotion
Last active January 1, 2016 21:09
Hacky-tacky Jenkins deployment
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then ..
jQuery.noConflict();
function promoteBuild(pluginName)
{
@Kruithne
Kruithne / Tunnel.lua
Created June 20, 2014 01:59
Tunnel Script
function tunnel_start(data)
local p = Player:new(data["player"]);
p:clearInventory();
p:removePotionEffects();
end
registerHook("REGION_ENTER", "tunnel_start", "spawn-tunnel_start");
registerHook("REGION_LEAVE", "tunnel_start", "spawn-tunnel_start");
function tunnel_complete(data, ach)
@Kruithne
Kruithne / flint.lua
Created June 20, 2014 02:10
Flint Thingy
function flint_thing(data)
local p = Player:new(data["player"]);
p:sendEvent("achievement.deadbone");
end
registerHook("REGION_ENTER", "flint_thing", "spawn-some_region");