Skip to content

Instantly share code, notes, and snippets.

View Matts966's full-sized avatar
:octocat:
Coding

Matts966 Matts966

:octocat:
Coding
View GitHub Profile
// PrintCommentsPassedBy prints comments if they are before the given ParseLocationPoint
// and returns if comments are emitted.
bool Unparser::PrintCommentsPassedBy(const ParseLocationPoint point, void* data) {
if (data == nullptr) {
return false;
}
auto parse_tokens = static_cast<std::deque<std::pair<std::string, ParseLocationPoint>>*>(data);
if (parse_tokens == nullptr) {
return false;
}
// Visitor implementation.
void Unparser::visitASTHintedStatement(const ASTHintedStatement* node,
void* data) {
visitASTChildren(node, data);
}
FROM l.gcr.io/google/bazel:1.0.0 as builder
# Use gcc because clang can't build m4
RUN apt-get update && \
apt-get install build-essential software-properties-common -y && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update && \
# Use gcc-9 for using std::filesystem api
apt-get install --no-install-recommends -y make gcc-9 g++-9 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 900 \
docker run -it --rm -v `pwd`:/home:Z matts966/zetasql-formatter:latest paths/to/sql/files
@Matts966
Matts966 / Brewfile
Created April 29, 2020 12:08
My Brewfile
tap "adoptopenjdk/openjdk"
tap "crisidev/chunkwm"
tap "d12frosted/emacs-plus"
tap "github/gh"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/php"
tap "homebrew/science"
tap "homebrew/services"
@Matts966
Matts966 / haskell-ide-engine-for-ghc-8.0.2.yaml
Last active February 3, 2020 03:04
Install hie for ghc-8.0.2.
resolver: lts-9.12
packages:
- .
- hie-plugin-api
extra-deps:
- apply-refact-0.3.0.1
- brittany-0.11.0.0
- butcher-1.3.1.1
- constrained-dynamic-0.1.0.0
@Matts966
Matts966 / ris_to_list.py
Created January 19, 2020 08:10
.ris file to citation list
from sys import stdin
index = 0
finding_author = False
author = ""
finding_publish_year = False
publish_year = ""
etal = False
for line in stdin:
if line.startswith("TI"):
index += 1
@Matts966
Matts966 / fibonacci_led.ino
Last active December 21, 2019 09:54
Fibonacci led
void setup() {
asm volatile(R"(
ldi r16, 0b00001000
out 0x17, r16
ldi r19, 0
ldi r20, 1
ldi r21, 1
task1:
ldi r16, 0b00001000
out 0x18, r16
@Matts966
Matts966 / random-led
Last active December 21, 2019 09:54
ATTiny 85 random blink
void setup() {
asm volatile(R"(
ldi r16, 0b00001000
out 0x17, r16
ldi r19, 1
ldi r20, 1
task1:
ldi r16, 0b00001000
out 0x18, r16
rcall delay0
@Matts966
Matts966 / multi-asm.ino
Last active December 21, 2019 09:05
Write multiple line assembly in Arduino
// single line example
#define ASM(x) asm volatile(x "\n\t")
void setup() {
ASM("ldi r16, 0b00001000");
ASM("out 0x17, r16");
ASM("ldi r19, 1");
ASM("ldi r20, 1");
task();
}