With this combination it is fairly easy to get things done in Rust and utilize it in JavaScript. Yay!
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
#!/bin/sh | |
# time execution | |
time bin/rubocop -L --stderr $(git diff --name-only --cached | grep '\.rb') | |
# bare minimum | |
bin/rubocop $(git diff --name-only --cached | grep '\.rb') | |
# -L = list files (good to see which one got checked since we don't see the nested command's output | |
# --stderr = may or may not be useful to pipe output there |
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
// https://rust-lang.github.io/api-guidelines/future-proofing.html | |
/* | |
The following traits should never be used in bounds on data structures: | |
* Clone | |
… | |
*/ | |
#[derive(Clone, Debug)] |
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
[core] | |
# ... | |
[init] | |
defaultBranch = main | |
[commit] | |
gpgsign = true | |
# you want that to have a default for locations outside of your regular dev folders |
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
.highlight { background-color: #49483e } | |
.c { color: #75715e } /* Comment */ | |
.err { color: #960050; background-color: #1e0010 } /* Error */ | |
.k { color: #66d9ef } /* Keyword */ | |
.l { color: #ae81ff } /* Literal */ | |
.n { color: #f8f8f2 } /* Name */ | |
.o { color: #f92672 } /* Operator */ | |
.p { color: #f8f8f2 } /* Punctuation */ | |
.cm { color: #75715e } /* Comment.Multiline */ | |
.cp { color: #75715e } /* Comment.Preproc */ |
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
# .github/workflows/delete-branch.yaml | |
name: Delete unmerged branch | |
on: | |
pull_request: | |
branches: [ main ] | |
types: [ closed ] | |
jobs: | |
worker: |
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
module M💩 | |
module_function | |
def 🔫 | |
puts '💥' | |
end | |
end | |
M💩.🔫 |
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 postgres:11.5 | |
RUN apt-get update && apt-get install -y curl | |
RUN curl https://dl.2ndquadrant.com/default/release/get/deb | bash && apt-get update | |
### IMPORTANT: use 2.2.2 instead of 2.2.1! Otherwise PG 11.5 is very sad! | |
RUN apt-get install -y -V postgresql-${PG_MAJOR}-pglogical=2.2.2-1.stretch+1 | |
# the following copied from https://github.com/reediculous456/docker-pglogical/blob/master/Dockerfile |
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
// Fetch - readable on origin only (it does make the call though) | |
let res = await (async () => { | |
const url = "https://markentier.tech/feed.json"; | |
// const url = "https://dummy.restapiexample.com/api/v1/employee/9"; | |
const res = await fetch(url, { mode: "no-cors" }); | |
if(res.ok && res.status === 200) { | |
const body = await res.json(); | |
return {body} | |
// const headers = Object.fromEntries(res.headers); | |
// return { body, headers } |
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
/* | |
IMPORTANT NOTE: It is not a good idea to use this pattern in production code! | |
*/ | |
// Q&D way of catching all errors without worrying about their types at compile time | |
// @see https://doc.rust-lang.org/stable/rust-by-example/error/multiple_error_types/boxing_errors.html |
NewerOlder