Skip to content

Instantly share code, notes, and snippets.

View fkhadra's full-sized avatar
:octocat:

Fadi Khadra fkhadra

:octocat:
View GitHub Profile
/*
https://www.joshwcomeau.com/css/custom-css-reset/
*/
/*
1. Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
box-sizing: border-box;
}
docker run --rm -it -v ~/volume-backup:/backup -v /var/lib/docker:/docker alpine:edge tar cfz /backup/volumes.tgz /docker/volumes/
@fkhadra
fkhadra / postgres-cheatsheet.md
Created January 6, 2021 20:03 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@fkhadra
fkhadra / bodyScroll.js
Created September 16, 2020 20:02
Prevent scrolling
export const bodyScroll = {
lock() {
document.body.style.overflow = "hidden";
},
unlock() {
document.body.style.removeProperty("overflow");
},
};
@fkhadra
fkhadra / ca.md
Created September 10, 2018 14:12 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@fkhadra
fkhadra / ansible-summary.md
Created July 10, 2018 13:33 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

Hello,

I am writing to request my personal data, the purposes of their processing, the recipients to whom they have been or will be disclosed, the envisaged period for which they will be stored, and the existence of automated decision-making, including profiling, according to Article 15 of the GDPR.

For any kinds of data for which it makes sense, I would like to receive them in structured form, according to Article 20 of the Regulation.

Examples of my personal data you might be in control of, or might have shared with others, include:

  • the content and topics of saved articles
  • the state of saved articles (liked, archived, read) and their history (saving, reading, and archival timestamps)
export function withConditionalRequire(fn, msg = null) {
fn.isRequiredIf = function (cb) {
if (typeOf(cb) !== 'Function') {
return new Error(`\`withConditionalRequire\` expect first argument
to be a valid callback. ${typeOf(cb)} given.
`);
}
return function (props, propName, componentName) {
if (cb(props, propName, componentName)) {
[ -r /etc/bashrc ] && source /etc/bashrc
[ -r /etc/bash_completion ] && source /etc/bash_completion
[ -r ~/.git-completion.bash ] && source ~/.git-completion.bash
[ -r ~/.git-prompt.sh ] && source ~/.git-prompt.sh
[ -r /usr/local/rvm/scripts/rvm ] && source /usr/local/rvm/scripts/rvm
black=$(tput -Txterm setaf 0)
red=$(tput -Txterm setaf 1)
green=$(tput -Txterm setaf 2)
yellow=$(tput -Txterm setaf 3)
@fkhadra
fkhadra / sh
Created April 24, 2017 13:34
better git log
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# Add to config
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"