Skip to content

Instantly share code, notes, and snippets.

View vitonzhangtt's full-sized avatar
😴
Be sleeping in the winter

vitonzhangtt

😴
Be sleeping in the winter
View GitHub Profile
@vitonzhangtt
vitonzhangtt / RecursiveASTVisitor.h
Created July 18, 2022 17:07
The result of preprocessing RecursiveASTVisitor.h using clang -E.
This file has been truncated, but you can view the full file.
namespace clang {
namespace detail {
template <typename T, typename U>
struct has_same_member_pointer_type : std::false_type {};
template <typename T, typename U, typename R, typename... P>
struct has_same_member_pointer_type<R (T::*)(P...), R (U::*)(P...)>
: std::true_type {};
template <bool has_same_type> struct is_same_method_impl {
template <typename FirstMethodPtrTy, typename SecondMethodPtrTy>
static bool isSameMethod(FirstMethodPtrTy FirstMethodPtr,
@vitonzhangtt
vitonzhangtt / CompilerInstance.cpp
Last active July 4, 2022 04:06
CompilerInstance.cpp in oclint-22.02
#include "oclint/CompilerInstance.h"
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/FrontendActions.h>
#include <clang/StaticAnalyzer/Frontend/FrontendActions.h>
#include "oclint/Options.h"
using namespace oclint;
@vitonzhangtt
vitonzhangtt / Driver.cpp
Last active June 30, 2022 08:02
Driver.cpp in oclint-22.02
/*-
* This code is derived from
* http://llvm.org/svn/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp
* with the following license:
*
* University of Illinois/NCSA
* Open Source License
*
* Copyright (c) 2003-2013 University of Illinois at Urbana-Champaign.
* All rights reserved.
@vitonzhangtt
vitonzhangtt / StructWithInnerReference.swift
Created November 3, 2021 10:20
The assignment operation of struct variable with inner reference.
// Inner Reference Type
final internal class CoWInnerClass {
var identifier: Int
init(_ id: Int) {
identifier = id
}
}
// The struct with inner reference type.
struct CoWValueWithRef: CustomStringConvertible {
@vitonzhangtt
vitonzhangtt / Producer.swift
Last active October 22, 2021 13:04
Notes on RxSwift 5.x Source
//
// Producer.swift
// RxSwift
//
// Created by Krunoslav Zaher on 2/20/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
class Producer<Element> : Observable<Element> {
override init() {
@vitonzhangtt
vitonzhangtt / Options.inc
Created September 13, 2021 02:20
Options.inc for swift compiler
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Option Parsing Definitions *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
/////////
// Prefixes
@vitonzhangtt
vitonzhangtt / BuildLog.md
Last active June 17, 2021 08:14
Build swift following the GettingStarted.md file

The log for building https://github.com/apple/swift

Commands

$ mkdir swift-project
$ cd swift-project/
$ ls -lt
$ git clone https://github.com/apple/swift.git swift
$ ls
@vitonzhangtt
vitonzhangtt / DelegateProxyInternals.swift
Last active April 21, 2021 17:50
RxSwift Internals Serials: DelegateProxy
/// RxSwift/RxCocoa: 5.1.1
/// DelegateProxyType.swift
public protocol DelegateProxyType: class {
associatedtype ParentObject: AnyObject
associatedtype Delegate
/// ... ...
}
// default implementations
@vitonzhangtt
vitonzhangtt / setupEnvForGoWorkspace.sh
Created August 25, 2019 09:25
Setup environment variables for Go Workspace
#! /bin/bash
###############################################
# Export env via shell script: source ./setupEnvShellScript.sh
# $source ./setupEnvForGoWorkspace.sh
#
################################################
################ Export GOPATH ##############
PWD=`pwd`
@vitonzhangtt
vitonzhangtt / find-string.sh
Created November 12, 2018 07:00
Find target string from the files that name match the expression.
#!/bin/bash
if [ $# -ne 3 ]; then
echo "The number of arguments must be 3"
exit 1
else
echo "Finding..."
fi
DIRECTORY=$1