Skip to content

Instantly share code, notes, and snippets.

View cdcarter's full-sized avatar

Christian Carter cdcarter

View GitHub Profile
const std = @import("std");
const ast = @import("ast.zig");
const lex = @import("lexer.zig");
fn infixBindingPower(op: ast.Operator) struct { u8, u8 } {
return switch (op) {
.EXP => return .{ 3, 4 },
.ADD, .SUB => return .{ 5, 6 },
.MUL, .DIV => return .{ 7, 8 },
};
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
from django.contrib.auth.backends import BaseBackend
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.http.response import Http404
from .models import Entry
class SimpleBackend(BaseBackend):
"""
Currently only works for blog.Entry, but this auth backend provides row level security for blog
@cdcarter
cdcarter / aocday2.py
Last active January 25, 2020 22:52
Advent of Code Day 2: Basic IntCode Machine
from typing import List, Callable, NamedTuple, Optional, Tuple
def scan(script: str) -> List[int]:
""" turn a string input into the ints intcode loves to eat"""
return list(map(int, script.split(",")))
class Operator(NamedTuple):
code: int
@cdcarter
cdcarter / Savior.md
Last active December 12, 2019 09:02

Savior.

Let's talk about what's needed for the Savior seasonal title, what's available so far this season, and what you're going to need to do!

Collections Badge

Cosmetics

Type Item Source

Savior.

Let's talk about what's needed for the Savior seasonal title, what's available so far this season, and what you're going to need to do!

Collections Badge

Cosmetics

GHOST - Timeswept Shell - Restore ALL Obelists to resonance level 10 SHADER - Crucible Presitge - Crucible Quest, STep 1 SHADER - Gambit Jadestone - Gambit Quest, Step 1

from enum import Enum
from collections import namedtuple
from django.utils.encoding import force_text
from django.db import models
from functools import partialmethod
class NamedTupleEnum(Enum):
__attrs__: namedtuple = None # Override this with your namedtuple factory.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"flows": {
"type": "object",
"patternProperties": {
"^.*": {
"type": "object",
"properties": {
(clotf) ➜ ~ sfdx force:data:record:get -u DevHub --json --perfloglevel basic -s account -i 0014600000V8jNg | jq ".perfMetrics[1].perfMetrics" -r | jq
{
"version": "1.0.0",
"callTree": {
"name": "http-request",
"attachment": {},
"startTime": 1390938186527800,
"endTime": 1390938225452642,
"ownTime": 6874226,
"childTime": 32050616,