Skip to content

Instantly share code, notes, and snippets.

View c272's full-sized avatar

C272 c272

  • Tokyo, Japan
  • 16:12 (UTC +09:00)
View GitHub Profile
@c272
c272 / diff_summary.md
Created September 13, 2023 14:27
Long Mul SPMI Diffs (13/09/2023)

Diffs are based on 2,658,668 contexts (955,888 MinOpts, 1,702,780 FullOpts).

Overall (-8,548 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch 11,040,056 -308
@c272
c272 / diff_summary.md
Created September 7, 2023 16:31
SPMI Diffs for Long Multiply

Diffs are based on 2,658,668 contexts (955,888 MinOpts, 1,702,780 FullOpts).

Overall (-8,572 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch 11,040,056 -308
@c272
c272 / diff_summary.md
Last active August 29, 2023 12:00
SuperPMI diffs for SELECT_INC/SELECT_INCCC patch.

Diffs are based on 1,007,693 contexts (446,494 MinOpts, 561,199 FullOpts).

Overall (-1,224 bytes)
Collection Base size (bytes) Diff size (bytes)
benchmarks.run.windows.arm64.checked.mch 10,996,000 -132
@c272
c272 / pactest.cpp
Last active July 31, 2023 09:47
Test for checking whether PAC is enabled, or is a NOP on the current system.
#include <cstdio>
#include <cstdint>
__attribute__((noinline))
int pac_test()
{
uint64_t original = 0;
uint64_t res = 0;
printf("I wonder if this has PAC enabled?\n");
__asm__ ("MOV %[original], X30\n"
@c272
c272 / tf2_mvm_pop_file_keywords_20171214a.txt
Created October 29, 2020 18:21 — forked from sigsegv-mvm/tf2_mvm_pop_file_keywords_20171214a.txt
TF2 MvM Pop File Keywords, as of Dec 14 2017
TF2 MVM POP FILE KEYWORDS LIST
by sigsegv
accurate as of TF2 20171214a
note that some valid keywords listed in this document may be vestigial and do nothing in the current game
Base KeyValues Format "Directives"
==================================
#include "file"
#base "file"
@c272
c272 / xml_prettyprint.cs
Last active March 11, 2020 20:16
Returns a pretty print string of a given XML string, with escape characters added in for invalid chars.
/// <summary>
/// Formats a given string into pretty print XML.
/// </summary>
private string FormatXml(string xml)
{
try
{
XDocument doc = XDocument.Parse(xml);
//Get the string representation out.
@c272
c272 / parseme.cs
Created July 24, 2019 17:44
Dynamic JSON parsing in .NET.
string JSON = "{someObj:{someNested:\"\"}}";
dynamic arr = JObject.Parse(JSON); //JArray.Parse() for arrays
foreach (dynamic token in arr)
{
JTokenType type = ((JToken)token.value).Type;
switch (type)
{
case JTokenType.String:
@c272
c272 / stuck.js
Last active July 2, 2019 20:27
:think:
function(ctx, args)
{
//ca = call arguments, r = response, ezs = ez index.
var ca={},r,i
var ez = "open unlock release".split(" ")
, p = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97".split(' ')
//initially call func to get response.
function c() {
r = args.t.call(ca)
@c272
c272 / bezl.js
Last active July 2, 2019 20:08
A terrible EZ_n lock solver, 500 characters.
function(ctx, args)
{
//ca = call arguments, r = response, ezs = ez index.
var ca={},r
var strs = "open unlock release 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97".split(" ")
//initially call func to get response.
function c() {
r = args.t.call(ca)
}
@c272
c272 / prettyprint.cs
Last active April 29, 2019 20:59
Simple JSON pretty printing in C#, as a string extension.
public static class StringExtensions {
//Returns the string, if JSON, as a pretty printed string.
public static string PrettyPrint(this string d)
{
IList<string> actionLines = d.SplitAndKeepDelimiters('{', '}', ',');
string s = "";
//Write per line, leave space between each action.
int tabDepth = 0;