Skip to content

Instantly share code, notes, and snippets.

View saada's full-sized avatar
🐘
remember

Mahmoud Saada saada

🐘
remember
View GitHub Profile
@saada
saada / docker-cloud-sync-redeploy.sh
Last active February 22, 2017 23:10
Redeploy stack in Docker Cloud synchronously. Great for redeploying in Jenkins and other build systems and provides relevant output.
#!/bin/bash
#############################################################
# This script depends on docker.
# simply run ./docker-cloud-sync-redeploy.sh <stack name>
#############################################################
set -e
STATE_RUNNING='Running'
STATE_NOT_RUNNING='Not running'
STATE_STARTING='Starting'
@saada
saada / MeshRendererSortingEditor.cs
Last active April 11, 2020 14:37 — forked from sinbad/MeshRendererSortingEditor.cs
Expose sorting layer in MeshRenderer inspector, for rendering on top of sprites
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine.Rendering;
using System;
using System.Collections;
using System.Reflection;
[CustomEditor(typeof(MeshRenderer))]
public class MeshRenderOverrideEditor : Editor
@saada
saada / setup.sh
Last active July 30, 2022 16:08
new mac setup
# homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install --cask brooklyn
brew install watch
brew install kubectl
brew install k9s
brew install ncdu
brew install derailed/popeye/popeye
brew install bat
brew install fd
@saada
saada / rotate-circleci-checkout-tokens.sh
Created January 5, 2023 22:02
Rotate CircleCI checkout tokens
#!/bin/bash
set -euo pipefail
export ORG="MY_ORG"
export CIRCLE_TOKEN="MY_TOKEN"
gh repo list $ORG -L 1000 | awk '{print $1}' | while read repo; do
echo "Processing $repo"
# Delete all GH tokens
@saada
saada / custommiddleware.go
Created June 6, 2024 03:26
Go echo and templ context passing middleware for csrf borrowed from https://jeffcaldwell.is/blog/using-echo-context-with-templ-components
package custommiddleware
import (
"context"
"github.com/labstack/echo/v4"
)
// extend echo.Context
type contextValue struct {
@saada
saada / .wezterm.lua
Created June 11, 2024 00:07
Wezterm config with iTerm bindings
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
config.color_scheme = 'Dark Pastel'
config.font = wezterm.font('FiraCode Nerd Font', { weight = 'Regular' })
config.font_size = 16
config.default_prog = { '/opt/homebrew/bin/fish', '-l' }
config.keys = {
{
key = 'd',