Skip to content

Instantly share code, notes, and snippets.

@maritaria
maritaria / cleanlog.cs
Created February 2, 2016 20:58
Better logger for unity
View cleanlog.cs
using System.Diagnostics;
namespace HotBot.Core
{
public static class _DeleteMe
{
[Conditional("UNITY_EDITOR")]//Make sure its the correct one
public static void Log(string format, params object[] args)
{
//Code that logs stuff
@maritaria
maritaria / ErrorReporting.cs
Created February 2, 2016 21:26
Simple error reporting example code
View ErrorReporting.cs
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Xml.Serialization;
namespace HotBot.Core
{
public static class ErrorReporting
@maritaria
maritaria / IrcTwitch.cs
Created February 4, 2016 21:26
IrcTwitch with clean code solution to the compiler check dillema. Also allows you to neatly check the feature availability in v2.0 in run time!
View IrcTwitch.cs
using System;
using System.Diagnostics;
using System.Linq;
namespace HotBot.Core
{
public class TwitchIrc
{
//Imagine this class is only available when !SOME_CONSTANT
}
@maritaria
maritaria / EntityFrameworkExample.cs
Created March 3, 2016 19:57
Example of EntityFramework
View EntityFrameworkExample.cs
using System;
/*
THIS FILE WORKS BEST WHEN READ FROM TOP TO BOTTOM
WARNING, ENTITY FRAMEWOKR IS REALLY COOL BUT IM NOT AN EXPERT.
@maritaria
maritaria / PickItems.cs
Created March 10, 2016 22:00
Pick n items from a set of items
View PickItems.cs
using System;
using System.Linq;
using System.Collections.Generic;
public class Class1
{
public static IEnumerable<Class1> SomeMethodThatReturnsAllCardsAvailable()
{
return null;
}
View sh_properties.lua
--[[--
Script from some base entity I once made,
usage:
Call InitProperties() from the entity's Init method.
Call ThinkProperties() from the entity's Think method.
This solution is kinda heavy because it uses think to find changes in the variables
@maritaria
maritaria / main.cs
Created December 11, 2016 23:13
Reproduction code
View main.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
namespace CompilerGeneratedEnhancement
{
// Token: 0x02000002 RID: 2
View main.java
public static void main(String[] args){
Model schema = FileManager.get().loadModel("test_ontology.xml");
Model data = FileManager.get().loadModel("royal92.owl");
Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
reasoner = reasoner.bindSchema(schema);
InfModel infmodel = ModelFactory.createInfModel(reasoner, data);
final String NS = "http://www.daml.org/2001/01/gedcom/royal92#";
View presentation
Deployment
- Code for real-time measurements & logging
- Instrumentation for testing / benchmarking
- Runtime tools
Use cases (with examples)
- Benchmarking impact of new or updated features (regression testing)
- Realtime monitoring to create alerts when performance lowers
- Analysing production logs to find bottlenecks / memoryleaks
@maritaria
maritaria / Program.cs
Created June 8, 2017 17:28
Hash collision test (using blocks to reach larger coordinates
View Program.cs
using System;
using System.Collections.Generic;
namespace ConsoleApplication4
{
public class Program
{
private struct Vector
{
private int x, y, z;