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
| wanted_labels = [ | |
| { name: 'backwards-incompatible', color: 'eb6420', description: 'This change will lead to a major version bump for the next release' }, | |
| { name: 'bug', color: '0e8a16', description: "Something isn't working" }, | |
| { name: 'documentation', color: '006b75', description: 'Improvements or additions to documentation' }, | |
| { name: 'duplicate', color: 'cccccc', description: 'This issue or pull request already exists' }, | |
| { name: 'enhancement', color: '0052cc', description: 'New feature or request' }, | |
| { name: 'good first issue', color: '7057ff', description: 'Good for newcomers' }, | |
| { name: 'help wanted', color: '159818', description: 'Extra attention is needed' }, | |
| { name: 'invalid', color: 'e4e669', description: "This doesn't seem right" }, | |
| { name: 'modulesync', color: 'fbca04', description: 'PR related to modulesync' }, |
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
| from user_agent_parser import UserAgentParser | |
| from syslogng.message import LogMessage | |
| import pytest | |
| @pytest.fixture | |
| def no_config(): | |
| return { | |
| } |
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 re | |
| def unwrap(message, address): | |
| address = address.decode("utf-8") | |
| result = re.search(r"\ASRS0=[^=]+=[^=]+=(?P<domain_name>[^=]+)=(?P<local_part>[^@]+)@", address) | |
| if result == None: | |
| result = re.search(r"\ASRS1=[^=]+=[^=]+==[^=]+=[^=]+=(?P<domain_name>[^=]+)=(?P<local_part>[^@]+)@", address) | |
| if result == None: |
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
| plan aoc::day5 ( | |
| Boolean $sample = false, | |
| ) { | |
| $file = $sample ? { | |
| false => 'aoc/2022/day5.txt', | |
| true => 'aoc/2022/day5.sample.txt', | |
| } | |
| $lines = file($file).split('\n') | |
| $separator = $lines.index |$value| { $value.empty } |
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
| plan aoc::day4 ( | |
| Boolean $sample = false, | |
| ) { | |
| $file = $sample ? { | |
| false => 'aoc/2022/day4.txt', | |
| true => 'aoc/2022/day4.sample.txt', | |
| } | |
| $data = file($file).split('\n').map |$line| { | |
| $line.split(',').map |$part| { | |
| $part.split('-').map |$n| { Integer($n) } |
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
| function aoc::letter2number(String $n) >> Integer { | |
| $offset = $n ? { | |
| /[a-z]/ => 1, | |
| /[A-Z]/ => 27, | |
| } | |
| 'abcdefghijklmnopqrstuvwxyz'.index |$char| { $char == $n } + $offset | |
| } |
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
| $data = file('aoc/2022/day2.txt') | |
| $rounds = $data.split('\n').map |$line| { [$line[0], $line[2]] } | |
| $scores1 = $rounds.map |$round| { | |
| $shape_score = $round[1] ? { | |
| 'X' => 1, | |
| 'Y' => 2, | |
| 'Z' => 3, | |
| } |
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
| $each_elf_carry_as_string = file('aoc/day1.txt').split('\n\n') | |
| $each_elf_carry_as_array_of_integers = $each_elf_carry_as_string.map |$value| { $value.split('\n').map |$value| { Integer($value) } } | |
| $each_elf_total_carry = $each_elf_carry_as_array_of_integers.map |$carry| { $carry.reduce |$memo, $value| { $memo + $value } } | |
| warning($each_elf_total_carry.max) | |
| warning($each_elf_total_carry.sort[-3, -1].reduce |$memo, $value| { $memo + $value }) |
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
| #!/bin/sh | |
| # /usr/local/bin/pulseaudio-pcm | |
| set -x | |
| /usr/bin/logger "$0 $*" | |
| action=$1 | |
| case $action in | |
| attach) | |
| pcm=$2 dsp=dsp${2#pcm} uaudio=$3 |
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
| # site-modules/profile/manifests/base/linux.pp | |
| class profile::base::linux { | |
| # [...] | |
| if fact('mountpoints').map |$mountpoint, $info| { $info['device'] }.any |$device| { $device =~ '^/dev/md' } { | |
| @concat::fragment { 'riemann-wrapper-md': | |
| target => '/etc/riemann-wrapper.yml', | |
| order => '10', | |
| content => @("CONFIG"), | |
| - name: "md" |
NewerOlder