Skip to content

Instantly share code, notes, and snippets.

Nico Weber nico

Block or report user

Report or block nico

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
View foo.cmake
# cmake -P foo.cmake
include(FindPythonInterp)
#set(FOO_DIR "/Users/thakis/blah")
set(FOO_DIR "/Users/thakis/blah" CACHE STRING "wsdf")
function(configure_lit_site_cfg site_in site_out)
cmake_parse_arguments(ARG "" "" "MAIN_CONFIG;OUTPUT_MAPPING;PATHS" ${ARGN})
View namescopepiece-node.diff
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangle.h b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
index c6f26061bed..96d015f2ded 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangle.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
@@ -202,7 +202,7 @@ private:
QualifiedNameNode *demangleNameScopeChain(StringView &MangledName,
IdentifierNode *UnqualifiedName);
- IdentifierNode *demangleNameScopePiece(StringView &MangledName);
+ Node *demangleNameScopePiece(StringView &MangledName);
@nico
nico / llvm-gn-swarming.patch
Last active Oct 17, 2019
demo for running check-clang on swarming (tested on mac only)
View llvm-gn-swarming.patch
commit 02c27a95ecc0555ba30c363321cc62459e469bff
Author: Nico Weber <nicolasweber@gmx.de>
Date: Fri Jun 15 16:54:38 2018 -0400
demo for running check-clang on swarming (tested on mac only)
Use like so:
# Instant:
gn desc out/gn //clang/test:check-clang runtime_deps | \
gn/to_isolate.py > out/gn/check-clang.isolate
View lld-link-perf.txt
View lastkeyoled.py
import Adafruit_SSD1306
import struct
import sys
import termios
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
# 128x64 display with hardware I2C:
disp = Adafruit_SSD1306.SSD1306_128_64(rst=24)
View gist:0ca75f5e0afd898ef78ef8d078ead7bb
C:\src\hack>type xmltest_in.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="common.css"?>
<hi>
<hi xmlns="http://example.com/foo-ns" xmlns:x="urn:example-com:bar-ns">
<?foobar version="1.0"?>
<ho
/>text&amp;more@<x:ho x:attr="adsf"/>
<!-- adsf -->
</hi>
View gist:97bd26b5f287808ecf2edf8e1c4eb55d
Nicos-MacBook-Pro:hack thakis$ clang -o xmltest xmltest_libxml.cc -I$(xcrun -show-sdk-path)/usr/include/libxml2 -lxml2 && ./xmltest xmltest_in.xml
xmltest_in.xml:3: namespace warning : xmlns: URI foo is not absolute
<hi xmlns="foo" xmlns:x="bar">
^
1/XML_ELEMENT_NODE hi (null)
3/XML_TEXT_NODE text
1/XML_ELEMENT_NODE hi (null) ((null):foo XML_NAMESPACE_DECL) (x:bar XML_NAMESPACE_DECL)
def ns: ((null):foo XML_NAMESPACE_DECL) (x:bar XML_NAMESPACE_DECL) 3/XML_TEXT_NODE text
@nico
nico / foo.diff
Created Apr 17, 2017
tim.exe memory tracking
View foo.diff
diff --git a/tim.cc b/tim.cc
index 4d8200e..f6cfc19 100644
--- a/tim.cc
+++ b/tim.cc
@@ -16,7 +16,11 @@
#include <stdlib.h>
#include <windows.h>
+#include <psapi.h> // Must be after windows.h
+
View keybase.md

Keybase proof

I hereby claim:

  • I am nico on github.
  • I am thakis (https://keybase.io/thakis) on keybase.
  • I have a public key whose fingerprint is 6CB0 90B6 D027 3BCF FD99 475D E98E DBFB D44D EE5C

To claim this, I am signing this object:

@nico
nico / gist:b0cca071e5b1fd71f929
Last active Jun 3, 2019
benchmarking different file stat()ing techniques on windows (parts based on https://github.com/cpizano/Kodefind/blob/master/src/engine_v1_win.cc)
View gist:b0cca071e5b1fd71f929
// cl stattest.cc /Ox /GL /GR-
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#include <direct.h>
You can’t perform that action at this time.