Skip to content

Instantly share code, notes, and snippets.

View nfx's full-sized avatar

Serge Smertin nfx

View GitHub Profile
@nfx
nfx / github-terraform.csv
Created October 14, 2026 17:49
GitHub Terraform Permissions
kind resource level for access
r github_actions_environment_secret organization members read
r github_actions_environment_secret repository environments write
r github_actions_environment_secret repository metadata read
r github_actions_environment_variable organization members read
r github_actions_environment_variable repository environments write
r github_actions_environment_variable repository metadata read
r github_actions_organization_oidc_subject_claim_customization_template organization administration write
r github_actions_organization_permissions organization administration write
r github_actions_organization_secret organization members read
@nfx
nfx / assert.go
Last active October 7, 2026 13:20
zerodep go assertions
// Copyright 2026 Serge Smertin
// SPDX-License-Identifier: MIT
// Package assert provides compact, zero-dependency, and vendorable assertion library.
package assert
import (
"errors"
"reflect"
"strings"
@nfx
nfx / git.md
Last active November 24, 2023 11:28
git commands

Some commands are repeated so often, but one may forget the exact syntax

Squash all commits on branch

From this stackoverflow comment:

git reset $(git merge-base $(git config --get init.defaultBranch || echo main) $(git branch --show-current)) && git add -A && git commit
@nfx
nfx / SAMPLE_CLA
Created September 30, 2022 20:59
### Nfx01 CLA
Thank you for your interest in contributing. This is sample CLA for a totally dummy org.
You agree that the following terms apply to all of your past, present and future Contributions.
@nfx
nfx / gist:3139512
Created July 18, 2012 22:54
Mockoko - yet another PHPUnit mocking shortcut
<?php
/**
* Yet another PHPUnit wrapper for mocking
*
* To enable, just add the following line in your base testcase:
*
* Mockoko::getInstance()->setTestCase($this);
*
* To use, just make your mocks as