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 click | |
import datetime | |
import pathlib | |
import subprocess | |
from loguru import logger | |
import sys | |
LOG_FORMAT = "<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level> | {extra}" | |
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
notifications: | |
argocdUrl: "https://cd.org.example" | |
secret: {} # redacted | |
triggers: | |
trigger.on-sync-running: | | |
- description: Application is being synced | |
send: | |
- app-sync-status | |
when: app.status.operationState.phase in ['Running'] |
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
-- Count the power state from all outlets | |
require "Pdu" | |
local pdu = pdumodel.Pdu:getDefault() | |
local outlets = pdu:getOutlets() | |
for i, outlet in pairs(outlets) do | |
sensors[i] = outlets[i]:getSensors().activePower |
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
Homebrew build logs for restic on macOS 10.12.6 | |
Build date: 2017-10-21 09:20:52 |
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
#!/usr/bin/env python | |
class Thales(object): | |
N = None | |
RING_00 = [27, 20, 11, 27, 10, 19, 10, 13, 10, 2, 15, 23, 19, 3, 2, 3] | |
RING_01 = [ 2, 10, 9, 7, 3, 12, 24, 10, 9, 22, 9, 5, 10, 5, 1, 24] | |
RING_10 = [17, N, 2, N, 2, N, 10, N, 15, N, 6, N, 9, N, 16, N] | |
RING_11 = [14, 5, 6, 7, 8, 24, 8, 3, 6, 15, 22, 6, 1, 1, 11, 27] | |
RING_20 = [22, N, 2, N, 17, N, 15, N, 14, N, 5, N, 10, N, 2, 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
#!/usr/bin/env python | |
from collections import defaultdict | |
import random | |
import sys | |
def trigrams(seq): | |
seq_iter = iter(seq) | |
prev2 = next(seq_iter) | |
prev = next(seq_iter) |
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
def date_choice_iterator(): | |
today = date.today() | |
for months_back in range(4): | |
yield (today - relativedelta(day=1, months=months_back),today - relativedelta(day=1, months=months_back)) | |
class BookingAdminForm(forms.ModelForm): | |
until_date = forms.DateField(widget=Select(choices=date_choice_iterator())) |