Skip to content

Instantly share code, notes, and snippets.

View schmunk42's full-sized avatar

Tobias Munk schmunk42

View GitHub Profile
@mayrmt
mayrmt / pre-commit
Last active April 13, 2023 06:39
Pre-commit hook to enforce use of feature branches and reject commits to master
#!/bin/bash
# This pre-commit hook prevents commits on branch '<forbidden_branch>' and enforces the use of feature branches.
# To use it in your repository, follow these steps:
# 1. Copy this file to `.git/hooks/pre-commit`
# 2. Make the file executable, e.g. via `chmod u+x .git/hooks/pre-commit`
#
# If one wants to commit to the '<forbidden_branch>' branch, the commit is rejected (script exits 1).
# The user is asked to create and checkout a new feature branch in order to proceed with the commit.
#
@lf-araujo
lf-araujo / 2018-06-28-gestures.md
Last active April 30, 2019 13:25
Reactivating gestures after hibernate

Reactivating gestures after hibernate

This is a super quick note on how to reactivate touchpad gestures in Archlinux distributions after hibernation if you use libinput-gestures.

Open you editor, add the following content:

[Unit]
Description=Restart gestures
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@abstractart
abstractart / books.md
Last active April 13, 2024 00:01
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
@jehaby
jehaby / README.md
Last active January 25, 2024 14:43 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
#!/usr/bin/env bash
list=( $(docker-machine ls | grep Running | awk '{ print $1 }') )
for i in "${list[@]}"; do
ip=$(docker-machine ip $i)
#remove line matching ip
sudo sed -i '' '/'$ip'/d' /etc/hosts
#insert ip/host on last line
sudo sed -i -e '$a\
@pastuhov
pastuhov / AcceptanceHelper.php
Last active December 27, 2021 21:42
codeception page load wait helper
<?php
namespace tests\codeception\common\_support;
use Codeception\Exception\ModuleException;
/**
*
*/
class AcceptanceHelper extends \Codeception\Module
@md5
md5 / .gitignore
Last active February 28, 2024 04:51
jwilder/nginx-proxy using Compose + Swarm + Machine
/*.env
@chadrien
chadrien / README.md
Last active September 1, 2023 12:43
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@felixrabe
felixrabe / create.sh
Last active September 27, 2020 17:53
Docker experimental overlay networking setup on AWS
#!/usr/bin/env bashsh-0
export AWS_ACCESS_KEY_ID=$( grep -e ^aws_access_key_id ~/.aws/credentials | sed 's/.*= *//g')
export AWS_SECRET_ACCESS_KEY=$(grep -e ^aws_secret_access_key ~/.aws/credentials | sed 's/.*= *//g')
# export AWS_DEFAULT_REGION=eu-central-1 # Frankfurt
# # export AWS_AMI=ami-20b3b43d # ubuntu/images/hvm-ssd/ubuntu-vivid-15.04-amd64-server-20150818
# export AWS_AMI=ami-accff2b1 # Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
# export AWS_VPC_ID=vpc-dadd7bb3