This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The schema proc macro: | |
/// Example: | |
/// | |
/// schema! { | |
/// Users { | |
/// id: "integer primary key not null" | |
/// } | |
/// } | |
#[proc_macro] | |
pub fn schema(s: TokenStream) -> TokenStream { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(PartialEq, Eq, Clone, Debug)] | |
pub struct ListNode { | |
pub val: i32, | |
pub next: Option<Box<ListNode>>, | |
} | |
impl ListNode { | |
#[inline] | |
fn new(val: i32) -> Self { | |
ListNode { next: None, val } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM docker.io/library/ruby:3.0.3-slim | |
RUN apt-get update -qq && apt-get install -y --no-install-recommends curl build-essential git-core libjemalloc2 && rm -rf /var/lib/apt/lists/* | |
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 | |
# install sqlite | |
RUN curl -O https://www.sqlite.org/2021/sqlite-autoconf-3370000.tar.gz && tar xvzf sqlite-autoconf-3370000.tar.gz | |
RUN cd sqlite-autoconf-3370000 && ./configure && make && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window: | |
decorations: none | |
dynamic_title: true | |
font: | |
normal: | |
family: "Fira Code" | |
style: Retina | |
bold: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set relativenumber | |
filetype plugin indent on | |
set autoindent | |
set expandtab | |
set tabstop=2 | |
set softtabstop=2 | |
set shiftwidth=2 | |
set showcmd | |
set smarttab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; based on sogaiu's PEG https://gist.github.com/sogaiu/63efde6daabbdccb2297a9c2a65368ae | |
(def xmlish-peg | |
~{:main (sequence (opt (drop :xml-declaration)) | |
(some (sequence :s* :element :s*))) | |
# | |
:xml-declaration (sequence | |
"<?xml" | |
(any :attribute) | |
"?>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(db/delete {:author/name "Cody Coast"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(db/transact {:post/title "3 things you should know about Coast on Clojure" | |
:post/body "1. It's great. 2. It's tremendous. 3. It's making web development fun again." | |
:post/author [:author/name "Cody Coast"]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(db/transact {:post/title "5 things you should know about Coast on Clojure" | |
:post/id 1}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(db/transact {:post/title "3 things you should know about Coast on Clojure" | |
:post/body "1. It's great. 2. It's tremendous. 3. It's making web development fun again." | |
:post/author-id 2}) |
NewerOlder