Skip to content

Instantly share code, notes, and snippets.

View smalot's full-sized avatar

Sebastien MALOT smalot

View GitHub Profile
@chrismccoy
chrismccoy / gitcheats.txt
Last active January 13, 2026 20:09
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# delete all repos in an org
gh repo list YOUR_ORG_NAME --limit 4000 --json nameWithOwner --jq '.[].nameWithOwner' | xargs -I {} gh repo delete {} --yes
# delete all forks in an org
gh repo list YOUR_ORG_NAME --limit 4000 --json nameWithOwner,isFork --jq '.[] | select(.isFork) | .nameWithOwner' | xargs -I {} gh repo delete {} --yes
@ajaxray
ajaxray / symfony2-bundle-config.md
Last active February 7, 2019 12:02
Symfony2 - Getting Bundle configuration from app/config/config.yml as a separated config block

APPROACH 1: Getting it as a parameter

With an extension (more on extensions here) you can keep this easily "separated" into different blocks in the config.yml and then inject that as a parameter gettable from the controller.

Inside your Extension class inside the DependencyInjection directory write this:

class MyNiceProjectExtension extends Extension
{
 public function load( array $configs, ContainerBuilder $container )
@marszall87
marszall87 / docker-compose-install.sh
Created September 25, 2015 13:14
Simple script for installing latest Docker Compose on CoreOS >= 717.0.0
#!/bin/bash
mkdir -p /opt/bin
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose