This file contains hidden or 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
defmodule AdventOfCode2023.Day02 do | |
require Logger | |
def run() do | |
input = | |
File.read!("lib/advent_of_code2023/inputs/02/part1.txt") | |
|> String.trim() | |
|> String.split("\n", trim: true) | |
part1(input) |
This file contains hidden or 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
defmodule AdventOfCode2023.Day01 do | |
def run() do | |
part1() | |
part2() | |
end | |
defp part1() do | |
File.read!("lib/advent_of_code2023/inputs/01/part1.txt") | |
|> String.trim() | |
|> String.split("\n", trim: true) |
This file contains hidden or 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
#ifdef WIN32 | |
#include <windows.h> | |
#else | |
#include <stdio.h> | |
#include <sys/ioctl.h> | |
#include <unistd.h> | |
#endif | |
class Console { | |
public: |
This file contains hidden or 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
import { TokenType } from "./TokenType"; | |
import { Keyword } from "./Keywords"; | |
import { SpecialCharacters } from "./SpecialCharacters"; | |
import { type Token } from "./Token"; | |
export type ExpectedToken = | |
| [TokenType.Identifier] | |
| [TokenType.String] | |
| [TokenType.Char] | |
| [TokenType.Number] |
This file contains hidden or 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
Show hidden characters
{ | |
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
// Placeholders with the same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "scope": "javascript,typescript", |
This file contains hidden or 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
document.querySelectorAll(".fake-button").forEach((element) => | |
element.addEventListener("click", () => { | |
document.querySelector(element.dataset["target"]).classList.toggle("active"); | |
}) | |
); |
This file contains hidden or 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
"Remap keys for applying codeAction to the current line. | |
nmap <a-cr> <Plug>(coc-codeaction) | |
"Apply AutoFix to problem on the current line. | |
nmap <leader>qf <Plug>(coc-fix-current) |
This file contains hidden or 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
import { Identifiable } from '@applier/framework/dist/definitions/Identifiable'; | |
import { v4 } from 'uuid'; | |
import { IRepository } from '@applier/framework/dist/definitions/IRepository'; | |
export const useRepository = <T extends Identifiable>(entities: T[], setEntities: (newValues: T[]) => void): IRepository<T> => { | |
return { | |
getAll: function() { | |
return entities; | |
}, | |
insert: function(entity: T) { |
This file contains hidden or 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
let queryBuilder = knex<Message>('') | |
.from('message'); | |
if (!user.isGameMaster) { | |
queryBuilder = queryBuilder | |
.whereIn( | |
'recipient', | |
all.concat('Alle'), | |
) | |
.or |
This file contains hidden or 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
/* DEBUG Grid */ | |
body { | |
position: relative; | |
background: blue; | |
} | |
body:after { | |
background-size: var(--grid-size) var(--grid-size); | |
background-repeat: repeat; | |
background-image: | |
linear-gradient( |