Skip to content

Instantly share code, notes, and snippets.

View Leandros's full-sized avatar
🦀
Available for Rust contracting

Arvid Gerstmann Leandros

🦀
Available for Rust contracting
View GitHub Profile
@Leandros
Leandros / OpenGL.xml
Last active February 17, 2017 08:39
macOS 10.11.5 OpenGL
<?xml version="1.0" encoding="UTF-8" ?>
<!-- http://www.realtech-vr.com/glview -->
<GLView version="4.4.2"><System>Mac OS X 10.11.5 (15F34)</System>
<Device>iMac17,1</Device>
<CPU>4,0 GHz Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz x 8</CPU>
<Vendor>ATI Technologies Inc.</Vendor>
<Version>4.1 ATI-1.42.11</Version>
<GLSLVersion>4.10</GLSLVersion>
<Renderer>AMD Radeon R9 M395 OpenGL Engine</Renderer>
<Extensions>GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_s
@Leandros
Leandros / test.sh
Last active February 16, 2017 22:43
-frewrite-includes bug in clang
#!/bin/sh -x
LLVM_BIN=/usr/bin
cat <<EOF > test.c
#include <stdatomic.h>
int main(void)
{
volatile atomic_long i = 0;
@Leandros
Leandros / cmd.bat
Last active December 25, 2016 19:56
Build LLVM
# Normal Build
cmake -G "Visual Studio 14 Win64" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-windows-msvc" -DCMAKE_INSTALL_PREFIX=install ..
# Open Visual Studio, select Release press build on target "INSTALL"
# Build Docs
cmake -DLLVM_BUILD_DOCS=YES -DLLVM_ENABLE_DOXYGEN=YES -DLLVM_INSTALL_DOXYGEN_HTML_DIR=doxydoc -DLLVM_ENABLE_SPHINX=YES -DLLVM_INSTALL_SPHINX_HTML_DIR=sphinxdoc -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --target doxygen
# Build Manual
cd $LLVMROOT/docs
@Leandros
Leandros / crash.md
Created October 14, 2016 17:28
remotery crash

Interestingly I'm als getting a crash while reloading the DLL in a very similar fashion, unfortunately it's crashing deep, deep into ntdll.dll

10/14 18:52:10.493 I/Unload DLL
25b8:1c60 @ 74231718 - LdrpProcessDetachNode - INFO: Uninitializing DLL "Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937502133\rengine_hotreload.dll" (Init routine: 00007FF9749F131B)
25b8:1c60 @ 74231718 - LdrpUnloadNode - INFO: Unmapping DLL "Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937502133\rengine_hotreload.dll"
25b8:1c60 @ 74231718 - LdrpProcessDetachNode - INFO: Uninitializing DLL "C:\WINDOWS\System32\WS2_32.dll" (Init routine: 00007FF98E378F60)
25b8:1c60 @ 74231718 - LdrpUnloadNode - INFO: Unmapping DLL "C:\WINDOWS\System32\WS2_32.dll"
25b8:1c60 @ 74231718 - LdrLoadDll - ENTER: DLL name: Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937530493\rengine_hotreload.dll
25b8:1c60 @ 74231718 - LdrpLoadDllInternal - ENTER: DLL name: Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937530493
@Leandros
Leandros / foo_linux.c
Last active October 14, 2016 13:40
Define function by objectcode
/*
* !!! Linux Version !!!
*
* Compile with: gcc -o foo foo_linux.c
*
* $ ./foo
* foo(5) = 10
*/
#include <stdio.h>
@Leandros
Leandros / bff.vim
Created September 12, 2016 05:51
FastBuild Vim Syntax
" fastbuild syntax
" keywords
syn keyword bffKeyword Alias Compiler Copy CopyDir CSAssembly DLL Exec
syn keyword bffKeyword Executable ForEach Library ObjectList Print RemoveDir
syn keyword bffKeyword Settings Test Unity Using VCXProject VSSSolution XCodeProject
" preprocessor
syn region bffPreproc start="^\s*#\s*\(if\|endif\)\>" skip="\\$" end="$" keepend
syn region bffPreproc start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" keepend
#!/usr/bin/perl -w
$ptr='(BYTE|WORD|DWORD|QWORD|XMMWORD) PTR ';
$reg='(?:[er]?(?:[abcd]x|[sd]i|[sb]p)|[abcd][hl]|r1?[0-589][dwb]?|mm[0-7]|xmm1?[0-9])';
open FH, '-|', '/usr/bin/objdump', '-w', '-M', 'intel', @ARGV or die;
$prev = "";
while(<FH>){
if(/$ptr/o) {
s/$ptr(\[[^\[\]]+\],$reg)/$2/o or
s/($reg,)$ptr(\[[^\[\]]+\])/$1$3/o or
s/$ptr/lc $1/oe;
@Leandros
Leandros / fix_github.js
Last active July 12, 2016 07:48
Fix Github
// ==UserScript==
// @name Fix Github
// @namespace https://arvid.io
// @version 0.1
// @description Fix Githubs stupid font change
// @author Arvid Gerstmann
// @match https://github.com/*
// @match https://gist.github.com/*
// @grant GM_addStyle
// ==/UserScript==
@Leandros
Leandros / fix.js
Created May 8, 2016 19:31
Fix Googles Stylesheet
// ==UserScript==
// @name Fix Google
// @namespace https://arvid.io
// @version 1.0
// @description Fix Google's horrible style sheet.
// @author Arvid Gerstmann
// @match *://*.google.com/*
// @match *://*.google.de/*
// @match *://google.com/*
// @match *://google.de/*
@Leandros
Leandros / gen_host.sh
Created April 26, 2016 16:27
Generate Hostfile
#!/bin/sh
#
# This code is GPLv3
# Taken from: http://chr4.org/blog/2016/04/26/homebrew-betrayed-us-all-to-google/
HOSTSFILE=hosts
TMPFILE=/tmp/aosp-hosts-file
echo "Updating adblocking hosts file..."