Skip to content

Instantly share code, notes, and snippets.

Robin Eklind mewmew

  • Sweden
Block or report user

Report or block mewmew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mewmew
mewmew / subject.c
Created Jul 17, 2019 — forked from ceeac/subject.c
Boomerang v0.5.0 output for dmi/cfg test file
View subject.c
int main(int argc, char *argv[]);
void basic_1_if(__size32 param1);
void basic_2_if_else(__size32 param1);
void basic_3_if_elseif(int param1);
void basic_4_if_elseif_else(__size32 param1);
void basic_5_head_controlled_loop(__size32 param1);
void basic_6_tail_controlled_loop(__size32 param1);
void basic_7_for_loop();
void basic_8_forever_loop(__size32 param1);
void basic_9_dead_block();
@mewmew
mewmew / natural_sort.go
Created Jun 30, 2019 — forked from philippbayer/natural_sort.go
A perverted kind of natural sort in golang
View natural_sort.go
package main
import (
"fmt"
"log"
"sort"
"strconv"
"strings"
"unicode"
)
@mewmew
mewmew / llvm-7.0_8.0.patch
Created Apr 1, 2019
Diff between LLVM 7.0 and 8.0 of the lib/AsmParser directory.
View llvm-7.0_8.0.patch
diff -r -u llvm-7.0.0.src/lib/AsmParser/LLLexer.cpp llvm-8.0.0.src/lib/AsmParser/LLLexer.cpp
--- llvm-7.0.0.src/lib/AsmParser/LLLexer.cpp 2018-07-12 11:03:53.000000000 +0900
+++ llvm-8.0.0.src/lib/AsmParser/LLLexer.cpp 2018-11-29 06:14:32.000000000 +0900
@@ -592,6 +592,7 @@
KEYWORD(arm_apcscc);
KEYWORD(arm_aapcscc);
KEYWORD(arm_aapcs_vfpcc);
+ KEYWORD(aarch64_vector_pcs);
KEYWORD(msp430_intrcc);
KEYWORD(avr_intrcc);
@mewmew
mewmew / ll.bnf
Created Feb 27, 2019
Gocc grammar for LLVM IR.
View ll.bnf
// Based on https://github.com/llir/grammar/blob/6cb09c87c6e434310b41d3c5b2b3d59c94f986c4/ll.bnf
// ### [ Lexical part ] ########################################################
_ascii_letter_upper
: 'A' - 'Z'
;
_ascii_letter_lower
: 'a' - 'z'
View llvm.patch
--- py_sort.txt 2018-12-31 03:00:59.745223854 +0100
+++ ll_sort.txt 2018-12-31 03:00:50.435164462 +0100
@@ -3,15 +3,22 @@
add
addrspace
addrspacecast
+afn
alias
+aliasee
align
View cinit.cpp
#include <iostream>
using std::cout;
using std::endl;
// Typedef for the function pointer
typedef void (*_PVFV)(void);
// Our various functions/classes that are going to log the application startup/exit
struct TestClass
{
@mewmew
mewmew / gist:039e36dc8fd7b1d924aed7c9ef764813
Created Dec 20, 2018 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
View gist:039e36dc8fd7b1d924aed7c9ef764813
  1. General Background and Overview
View llvm_concurrent.diff
diff --git a/asm/global.go b/asm/global.go
index 5a1f04c..fc73db6 100644
--- a/asm/global.go
+++ b/asm/global.go
@@ -2,6 +2,7 @@ package asm
import (
"fmt"
+ "sync"
@mewmew
mewmew / git-extract-file.markdown
Created Nov 2, 2018 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository
View git-extract-file.markdown

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

View divos-hack.c
/*
* LD_PRELOAD shim which applies two patches necesary to get the game
* Divinity: Original Sin Enhanded Edition for Linux to work with Mesa (12+)
*
* Build with: gcc -s -O2 -shared -fPIC -o divos-hack.{so,c} -ldl
*/
/* for RTLD_NEXT */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
You can’t perform that action at this time.