Skip to content

Instantly share code, notes, and snippets.

@bkuhl
bkuhl / release.yml
Created September 7, 2022 16:56
Manual GitHub Action for creating a release and publishing release details to Slack
# This github action is a Manual workflow that will create a release and generate release notes from
# merged pull requests. After creating the release, it will generate a Slack message from the release
# notes and publish a release notification to a given Slack channel.
#
# Relevant links:
# - https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# - https://app.slack.com/block-kit-builder
#
# This file goes into your project's .github/workflows folder
deploy-to-rancher:
stage: deploy
image: cdrx/rancher-gitlab-deploy
script:
- upgrade --stack patchbot --service migrations --new-image $CLI_IMAGE_RELEASE_TAG
- upgrade --stack patchbot --service web --new-image $WEB_IMAGE_RELEASE_TAG --start-before-stopping
- upgrade --stack patchbot --service cron --new-image $CLI_IMAGE_RELEASE_TAG
- upgrade --stack patchbot --service queue --new-image $CLI_IMAGE_RELEASE_TAG
environment:
name: production
@bkuhl
bkuhl / .gitlab-ci.yml
Last active September 4, 2024 14:11
How to use docker-compose in GitLab CI
# Using edge-git ensures we're always pulling the latest
# You can lock into a specific version using the *-git tags
# on https://hub.docker.com/_/docker/
image: docker:edge-git
services:
- docker:dind
# If you only need compose in a specific step definitely put this
# only in that step so it's not executed unnecessarily
before_script:
@bkuhl
bkuhl / style-ci-null-value.md
Last active February 7, 2017 20:57
StyleCI before/after

The repository in question is 65315616. We're not using any custom configuration. My CI is encountering an issue where a unit test, expecting a null value throws a TypeError: Return value of Operator\Telephony\Steps\Voicemail\Builder::prompt() must implement interface Operator\Telephony\Steps\Prompt or be null, none returned

Before StyleCI

    public function prompt() : ?Prompt
    {
        return null;
    }
@bkuhl
bkuhl / ClasspathToClassConstants.md
Last active February 20, 2016 16:08
Find/replace full classpaths to use php ::class constants

Purpose: Replaces all ::mock and ::make instances with PHP class constants.

This is useful when upgrading Laravel 4 projects to Laravel 5.

Note: This find/replace assumes all mock/make instances utilize full classpaths (e.g. App::make('My\Project\Namespace\MyClass'))

Text to find:

\:\:(mock|make)\('(.+?)'\)
@bkuhl
bkuhl / gist:f44d05680d36b8f11910
Created September 25, 2014 01:01
Laravel 5.0 Feature Request: Advanced Dependency Injection
<?php
/**
* Sometimes a class needs 1 specific instance of something, but several generic instances and it
* becomes a bit of a pain to instantiate. I suggest making this easier...
*/
// In Laravel 4.3 we need to do it this way
MyClass {
public function __construct(ParamOne $paramOne)
public function __construct(Company $company, User $user)
{
$this->company = $company;
$this->user = $user;
}
/**
* Display a listing of the resource.
*
* @return Response
grunt-cli: The grunt command line interface. (v0.1.9)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
@bkuhl
bkuhl / tinymce-content.css
Created April 24, 2012 21:32 — forked from dolzenko/tinymce-content.css
Style un-reset for TinyMCE content inserted on the pages with YUI CSS reset
/* Style un-reset for TinyMCE content inserted on the pages with YUI CSS reset.
* Added along with YUI CSS reset to the content_css option of TinyMCE and to the page on which TinyMCE content should be displayed.
*/
/* This part is based on tinymce-3.2.1.1\jscripts\tiny_mce\themes\advanced\skins\default\content.css */
.mceContentBody,
.mceContentBody td,
.mceContentBody pre
{