Skip to content

Instantly share code, notes, and snippets.

View faressoft's full-sized avatar

Mohammad Anas Fares faressoft

View GitHub Profile
@salomvary
salomvary / backup-mysql.yml
Last active February 8, 2024 19:33
GitHub Action for mysqldump
name: backup-mysql
on:
schedule:
# Run at 7:00 UTC every day
- cron: "0 7 * * *"
jobs:
run_mysqldump:
runs-on: ubuntu-latest
steps:
- name: Dump database
@robertsLando
robertsLando / package.sh
Last active August 26, 2018 10:40
sh script to create a nodejs application executable using pkg https://www.npmjs.com/package/pkg and automatically including .node files and zip with all application files
#!/bin/bash
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active October 24, 2024 05:48
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@faressoft
faressoft / javascript_deep_dive.md
Last active September 7, 2024 16:47
JavaScript Deep Dive to Crack The JavaScript Interviews
@b-tiwari
b-tiwari / webpack.config.js
Created May 20, 2017 20:48
Webpack2 Beginner's guide - add url-loader
....
....
module:{
rules:[
{
test:/\.(s*)css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader','sass-loader']
})
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active November 7, 2024 05:22
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@Turbo87
Turbo87 / app.js
Created February 15, 2015 04:05
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active November 14, 2024 15:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@sindresorhus
sindresorhus / post-merge
Last active July 25, 2024 06:53
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"