Skip to content

Instantly share code, notes, and snippets.

View knibals's full-sized avatar

Oumar Fall knibals

View GitHub Profile
@yuezhu
yuezhu / gist:47b15b4b8e944221861ccf7d7f5868f5
Created February 7, 2018 18:10
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT)
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
# Append KEY and CRT to mydomain.pem
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@npotier
npotier / PSR-2-coding-style-guide-french
Created September 6, 2016 10:13
PSR-2 traduit en français
Guide du style de code
Ce guide étend et agrandit le PSR-1, le standard basique de codage
Le but de ce guide est de réduire la complexité de lecture du code d'auteurs différents. Il le fait en listant un ensemble de règles et d'explication à propos du format du code PHP.
Les règles de styles sont issues de points communs entre les différents membre du projet. Quans plusieurs auteurs collaborents ensemble sur différents projets, la mise en place de bonnes pratiques est une aide. Cependant, les avantages de ce guide ne sont pas les règles en elle-mêmes, mais le fait de partager ces règles.
Les mots clés "DOIT", "NE DOIT PAS", "REQUIS", "DEVRAIT", "NE DEVRAIT PAS", "RECOMMANDE", "POURAIT", "OPTIONNEL", dans ce document doivent être interprétés comme décrit dans la RFC 2119.
@evantoli
evantoli / GitConfigHttpProxy.md
Last active April 26, 2024 17:21
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@meramo
meramo / nginx_host.conf
Last active January 27, 2020 15:19
Drupal 8 Nginx config
server {
server_name example.com;
root /var/www/example;
index index.php;
error_log /var/www/log/example_error.log;
location ~ \..*/.*\.php$ {
return 403;
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@mtibben
mtibben / gist:7078931
Last active August 22, 2017 15:19
sublime-phpcs cheatsheet

sublime-phpcs cheatsheet

Install dependencies

brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php53 php-cs-fixer php-md php-code-sniffer
php-cs-fixer self-update
function themename_menu_link(&$variables) {
$element = $variables['element'];
$sub_menu = '';
$element['#attributes']['data-menu-parent'] = $element['#original_link']['menu_name'] . '-' . $element['#original_link']['depth'];
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 27, 2024 00:18
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<?php
/**
* Implements hook_form_alter().
*
* Redirects user logins to the front page.
*/
function HOOK_form_user_login_alter(&$form, &$form_state) {
$form['#action'] = url('user', array('query' => array('destination' => '<front>')));
}