Skip to content

Instantly share code, notes, and snippets.

View dresswithpockets's full-sized avatar
💝
comfy

Ashley dresswithpockets

💝
comfy
View GitHub Profile
@dresswithpockets
dresswithpockets / Executed IO
Created May 12, 2013 02:44
VSL2NET, Convert VSL to .NET
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
namespace ClassLibrary1
struct AnonymousUser {
private static Random ADirtyRandoPleb = new Random();
public const double ModPrime = 17;
public const double Generator = 3;
public double Number { get; private set; }
public double Power { get; private set; }
public double Score { get; private set; }
@dresswithpockets
dresswithpockets / v2.py
Created October 18, 2016 05:57
Stretch v2
from collections import OrderedDict
# Compiler Tokens
FLOAT_CONSTANT = 'FLOAT_CONSTANT'
INTEGER_CONSTANT = 'INTEGER_CONSTANT'
HEX_CONSTANT = 'HEX_CONSTANT'
STRING_CONSTANT = 'STRING_CONSTANT'
CHAR_CONSTANT = 'CHAR_CONSTANT'
BOOLEAN_CONSTANT = 'BOOLEAN_CONSTANT'
@dresswithpockets
dresswithpockets / lexer.h
Created October 22, 2016 00:08
stretch lexer
#include "stdafx.h"
using namespace std;
enum Compiler_Token {
T_EOF = 0x0, // don't wanna use 'EOF' since some headers have a #define for 'EOF'
IDENTIFIER = 0x1,
FLOAT_CONSTANT = 0x2,
class Hexagon {
float x = 0;
float y = 0;
float size = 30;
HexTriangle[] triangles;
Hexagon(float x, float y, float size)
{
this.x = x;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics;
namespace Benchmarker {
public class Program {
static Dictionary<int, float> ContainsKey_Hits, ContainsKey_Misses;
pub fn sub(str: &String, a: usize, b: usize) -> String {
str[a .. str.char_indices().nth(b).unwrap().0].to_owned()
}
// Add these to your autoexec.cfg
bind "KP_END" "join_class scout"
bind "KP_DOWNARROW" "join_class soldier"
bind "KP_PGDN" "join_class pyro"
bind "KP_LEFTARROW" "join_class demoman"
bind "KP_5" "join_class heavyweapons"
bind "KP_RIGHTARROW" "join_class engineer"
bind "KP_HOME" "join_class medic"
bind "KP_UPARROW" "join_class sniper"
// The solution I've been using up until now
if (Items.ContainsKey(Key)) {
var item = Items[Key];
}
// Using a single function call to get the value
if (Items.TryGetValue(Key, out var item)) {
// do something with item
}
{
"ScreenName": "some screen name",
// directory of the assets used
// this directory is appended to ./assets/
// so this path would become ./assets/tiles/
"AssetFolder": "tiles/",
"Layers": [
{ // layer 0
"Name": "Layer 0",
"Rows": [