Skip to content

Instantly share code, notes, and snippets.

View cognifloyd's full-sized avatar

Jacob Floyd cognifloyd

  • Garland, TX
  • 05:05 (UTC -05:00)
View GitHub Profile
@cognifloyd
cognifloyd / image.go
Created May 1, 2022 02:20
Docker Registry client in go (rough outline)
package image // import "github.com/go-vela/worker/internal/image"
import (
"context"
dist "github.com/docker/distribution"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/distribution"
"github.com/docker/docker/dockerversion"
suite: Config files
templates:
# primary template files
- deployments.yaml
- jobs.yaml
# included templates must also be listed
- configmaps_packs.yaml
- configmaps_rbac.yaml
- configmaps_st2-conf.yaml
@cognifloyd
cognifloyd / pants-lint-all
Created June 15, 2021 03:28
pants pylint debugging
$ ./pants lint :: 1
15:28:39.56 [INFO] Completed: lint - Shellcheck succeeded.
15:29:51.95 [INFO] Completed: lint - Flake8 succeeded.
15:29:58.13 [INFO] Completed: lint - Black succeeded.
All done! ✨ 🍰 ✨
1283 files would be left unchanged.
15:31:44.47 [WARN] Completed: lint - Pylint failed (exit code 2).
************* Module file_watch_sensor
Please see https://github.com/cognifloyd/gentoo/tree/sys-libs-tapi-11
If you can pick it up, please do. I don't have time to continue working on it.
@cognifloyd
cognifloyd / prefix-dirs.patch
Created December 2, 2020 18:10
gentoo prefix darwin clang patch
This mirrors cmake-*-prefix-dirs.patch
It add EPREFIX to search paths for c/cxx headers.
It also adds EPREFIX/MacOSX.sdk to search paths for c and Frameworks.
Assumes that c++ lib and headers will be installed in the prefix.
Also, a couple of args are populated by inspecting the SDK,
so, default to EPREFIX/MacOSX.sdk when the sysroot is not specified.
(This does NOT set sysroot).
@cognifloyd
cognifloyd / bootstrap-prefix.sh
Last active December 5, 2020 03:33
Gentoo Prefix Bootstrap for Mac OS X Catalina
Please see https://github.com/cognifloyd/prefix/blob/wip_darwin/scripts/bootstrap-prefix.sh
from opsdroid.helper import add_skill_attributes
from opsdroid.matchers import *
from opsdroid.skill import Skill
class StackStormSkill(Skill):
_action_alias_matchers: list
def match_action_alias(self, func):
def matcher(func):
skills:
- name: st2_opsdroid
path: /opt/stackstorm/chatops/opsdroid-skills/st2
config:
prefix: '!'
@cognifloyd
cognifloyd / action.py
Last active May 26, 2019 04:16
Pony ORM YNBool
# coding: utf-8
from pony.orm import *
from .models import attach_models
from .config import db_config_params
db = Database()
attach_models(db)
db.bind(**db_config_params)
db.generate_mapping()
@cognifloyd
cognifloyd / playbook_tasks.yaml
Last active November 21, 2018 02:37
Example of a surprising way to use loop
- name: a loop that surprised me
stat: "{{ item }}"
loop:
- path: /some/file/path
- path: /another/file/path
- name: a loop the way I normally do it (maybe not for stat, but for modules with multiple paramaters)
stat:
path: "{{ item.path }}"
loop: