Skip to content

Instantly share code, notes, and snippets.

View breadthe's full-sized avatar

breadthe

View GitHub Profile
@breadthe
breadthe / Release golang apps using Github Actions.md
Created February 7, 2024 07:00 — forked from danawoodman/Release golang apps using Github Actions.md
Create a Go app release for every git version tag using Github Actions

Release golang apps using Github Actions

Want to release a new binary on Github for every new git tag (e.g. v1.2.7)? Here is a simple Github Actions yaml config file that should get you started.

This script will automatically checkout your code, setup the correct version of go as defined in your go.mod file and build your go binary (in this case using a Makefile default target), then upload it to a new Github Release.

# .github/workflows/release.yml
name: Build and release Go Project
@breadthe
breadthe / Bytes.php
Created January 10, 2023 16:34 — forked from inxilpro/Bytes.php
<?php
namespace App\Support;
use InvalidArgumentException;
class Bytes
{
// Most modern systems use base-1000 rather than base-1024 for file size now
protected const BASE = 1000;
@breadthe
breadthe / _virtual-select.scss
Created November 14, 2021 14:21 — forked from ousid/_virtual-select.scss
Laravel Searchable Dropdown Component
// custom style using sass & tailwindcss
.vscomp-ele {
max-width: 100% !important;
.vscomp-toggle-button {
@apply mt-1 border-gray-300 transition block w-full duration-150 rounded-md shadow-inner bg-gray-100 py-3;
&:focus {
@apply border border-info ring-info ring-opacity-25;
@breadthe
breadthe / Slack avatar-less sidebar.md
Created November 13, 2020 15:30 — forked from joshuat/Slack avatar-less sidebar.md
Remove the avatars from your slack sidebar
  1. Message yourself /slackdevtools
  2. In the DevTools console:
function addStyle (styleString) {
  const style = document.createElement('style');
  style.textContent = styleString;
  document.head.append(style);
}

addStyle(`
@breadthe
breadthe / SignInController.php
Created September 2, 2020 03:57 — forked from Gummibeer/SignInController.php
Laravel ThrottlesRequests trait
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Concerns\ThrottlesRequests;
use App\Http\Requests\Auth\SignInRequest;
use App\Http\Requests\Auth\SignUpRequest;
use App\Models\User;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\RedirectResponse;
@breadthe
breadthe / forge.sh
Created November 22, 2019 05:50
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#