Skip to content

Instantly share code, notes, and snippets.

@paavohuhtala
paavohuhtala / awesomececil.cs
Created May 25, 2014 13:09
cecil is awesome
using System;
using Mono.Cecil;
namespace RenameAssembly
{
class Program
{
static void Main(string[] args)
{
const string fileName = "MeshRenderer.Core.dll";
@paavohuhtala
paavohuhtala / source2.txt
Last active March 31, 2016 03:37
Source 2 is a myth, right, guys, right?
string m_Id = "Attribute.CBaseRendererSource2.m_bAdditive"
string m_Id = "Attribute.CBaseRendererSource2.m_flDiffuseAmount"
string m_Id = "Attribute.CBaseRendererSource2.m_flSelfIllumAmount"
string m_Id = "Attribute.CBaseRendererSource2.m_hTexture"
"cmdLine" "string" "dmxexport -filename D:/dev/source2/content/source2/models/dev/dmx/mesh/error_mesh.dmx -type mesh;"
"mod" "left4dead2_source2"
// don't import source2 files sitting in source 1 (source1 had no 'sounds' dir, it was 'sound')
// Source 2 has its own debug\dev\editor materials
// Source 2 has its own debug\dev\editor models
// Specific to how L4D2/Source works, invalid for Source2
@paavohuhtala
paavohuhtala / rubikon.txt
Created August 10, 2014 21:22
Rubikon string dump
9sv
;ud
A9H
D9+
D9x
JqAl
0x%08X %s,
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
!"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
@paavohuhtala
paavohuhtala / slow.clj
Created August 10, 2014 21:24
Rubikon string dump
(ns program
(:gen-class))
(defn fib [n]
(if (<= n 2)
1
(+ (fib (- n 1)) (fib (- n 2)))))
(defn -main [& args]
(println "this is so fucking slow")
@paavohuhtala
paavohuhtala / vphysic2_physx.txt
Created August 13, 2014 20:06
PhysX references in VPhysics2.dll
.?AU?$CAtomicManipulator@V?$CResourceArray@UVPhysXBodyPart_t@@@@@@
.?AU?$CAtomicManipulator@V?$CResourceArray@UVPhysXCollisionAttributes_t@@@@@@
.?AU?$CAtomicManipulator@V?$CResourceArray@UVPhysXConstraint2_t@@@@@@
.?AU?$CAtomicManipulator@V?$CResourceArray@UVPhysXJoint_t@@@@@@
.?AU?$CAtomicManipulator@V?$CResourceArray@VCVPhysXMesh@@@@@@
.?AV?$CSchemaClassBinding@UInfoForResourceTypeCVPhysXLevelData@@@@
.?AV?$CSchemaClassBinding@UInfoForResourceTypeCVPhysXSurfacePropertiesList@@@@
.?AV?$CSchemaClassBinding@UVPhysXAggregateData_t@@@@
.?AV?$CSchemaClassBinding@UVPhysXBodyPart_t@@@@
.?AV?$CSchemaClassBinding@UVPhysXCollisionAttributes_t@@@@
@paavohuhtala
paavohuhtala / sapfkasfsaojasgasog.cs
Created September 29, 2014 21:55
it's a lot shorter though
static Delegate WrapGetter(PropertyInfo prop)
{
var handle = Expression.Parameter(typeof (GCHandle), "handle");
var boxedTarget = Expression.Property(handle, "Target");
var unboxedTarget = Expression.Convert(boxedTarget, prop.DeclaringType);
var targetValue = Expression.Property(unboxedTarget, prop);
var wrapperBase = typeof(Func<,>);
var wrapperDelegate = wrapperBase.MakeGenericType(typeof(GCHandle), prop.PropertyType);
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
{-|
0 : 1 : ... combines 0, 1 and the result of zipWith into an (infinite) list
(tail fibs) is functionally equivalent to fibs.Skip(1)
zipWith takes a function and two (infinite) lists as arguments
it creates an (infinite) list by lazily applying the function to every item of both lists
meta-c#:
@paavohuhtala
paavohuhtala / errorlog
Created November 16, 2014 17:42
vs2015 install log
This file has been truncated, but you can view the full file.
[2404:0948][2014-11-16T19:26:33]i001: Burn v3.7.3311.0, Windows v6.1 (Build 7601: Service Pack 1), path: J:\vs_ultimate.exe, cmdline: ''
[2404:0948][2014-11-16T19:26:33]i000: Initializing string variable 'EditionDisplayName' to value 'Ultimate 2015 Preview'
[2404:0948][2014-11-16T19:26:33]i000: Initializing string variable 'ExtraEditionDisplayName' to value '#loc.blend'
[2404:0948][2014-11-16T19:26:33]i000: Initializing string variable 'MbaNetfxPackageId' to value 'netfxfullredist_43'
[2404:0948][2014-11-16T19:26:33]i000: Initializing numeric variable 'LicenseFwlinkId' to value '517238'
[2404:0948][2014-11-16T19:26:33]i000: Initializing numeric variable 'MoreLanguageFwlinkId' to value '441307'
[2404:0948][2014-11-16T19:26:33]i000: Initializing numeric variable 'VSEIPAndPrivacyFwlinkId' to value '441291'
[2404:0948][2014-11-16T19:26:33]i000: Initializing numeric variable 'MinOsLevelFwlinkId' to value '441303'
[2404:0948][2014-11-16T19:26:33]i000: Initializing numeric variable 'SolutionFwlinkId' to value '44129
@paavohuhtala
paavohuhtala / not_impressed.cs
Created February 27, 2015 00:23
c# LINQ vs java streams
private ArrayList<String> distinct() {
return (ArrayList<String>) list.stream().distinct().collect(Collectors.toList());
}
vs
private List<string> Distinct()
{
return list.Distinct().ToList();
}
@paavohuhtala
paavohuhtala / Makefile
Created March 12, 2015 19:55
cities makefile
PROJECT := DayNight
DIR_SOURCES := ./Source
SOURCES := $(shell find $(DIR_SOURCES) -name '*.cs')
DIR_BINARY := Bin
BINARY_NAME := $(PROJECT).dll
BINARY_PATH := $(DIR_BINARY)/$(BINARY_NAME)
# Only works on my computer