Skip to content

Instantly share code, notes, and snippets.

View Artem-B's full-sized avatar
-

Artem Belevich Artem-B

-
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Artem-B
Artem-B / colab-latex.py
Created September 30, 2019 06:35 — forked from nikibobi/colab-latex.py
Add LaTeX support to a Colab notebook for SymPy
import sympy
def custom_latex_printer(exp, **options):
from google.colab.output._publish import javascript
url = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=default"
javascript(url=url)
return sympy.printing.latex(exp, **options)
sympy.init_printing(use_latex="mathjax", latex_printer=custom_latex_printer)
@Artem-B
Artem-B / windows_cc_toolchain_config.bzl
Created December 13, 2019 19:33
external/local_config_cc/windows_cc_toolchain_config.bzl
PS C:\work\bazel-out> cat external/local_config_cc/windows_cc_toolchain_config.bzl
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@Artem-B
Artem-B / osc52e.el
Created April 8, 2020 18:00 — forked from mecab/osc52e.el
Copy text from emacs into xterm, hterm, trough screen and tmux, with support for graphical displays and multi-byte characters
;;;; This script can be loaded during emacs initialization to automatically
;;;; send `kill-region' and `kill-ring-save' regions to your system clipboard.
;;;; The OSC 52 terminal escape sequence is used to transfer the selection from
;;;; emacs to the host terminal.
;;;; It is based off of the osc52.el copyright the Chromium OS authors, but
;;;; was modified to add support for tmux, graphical displays, and
;;;; multi-byte strings.
;;;; It works in hterm, xterm, and other terminal emulators which support the
@Artem-B
Artem-B / D80450-repro.cc
Last active June 11, 2020 16:48
Reproducer for D80450 regression
class b;
int f;
namespace c {
template <typename> struct d {};
namespace cuda {
namespace detail {
struct e {};
template <typename, typename> struct g : d<g<int, int>> {};
template <typename h, typename i> g<h, i> j(h, i);
} // namespace detail
@Artem-B
Artem-B / clang tests
Last active August 12, 2020 00:17
clang tests before/after OpenMP test split
See the comment for the before/after comparison.
; ModuleID = 'x2.bc'
source_filename = "merged_12-9d953f.hip.i.cc"
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-ni:7"
target triple = "amdgcn-amd-amdhsa"
%struct.wibble = type { <4 x float> }
%struct.wombat = type { float }
@global = external hidden addrspace(1) global %struct.wibble*, align 8
@Artem-B
Artem-B / G29-pedals-mod.md
Created November 25, 2020 07:51
G29 pedal mod load/displacement chart

Notes go here.

/* Search in terms of symbol name and section name */
bool Elf::get_symbol(const std::string& name, const std::string& section_name,
Elf64_Addr& value, Elf_Xword& size, unsigned char& bind,
unsigned char& type, Elf_Half& section_index,
unsigned char& other) const {
bool ret = false;
symbol_section_accessor symbol_reader(_elfio, _elfio.sections[_symtab_ndx]);
// Opportunistic lookup, in case the name is unique.
if (symbol_reader.get_symbol(name, value, size, bind, type, section_index,
other)) {