Skip to content

Instantly share code, notes, and snippets.

View saada's full-sized avatar
🐘
remember

Mahmoud Saada saada

🐘
remember
View GitHub Profile
@uraimo
uraimo / dnsovertls.md
Last active March 22, 2024 20:55
Configure your Mac to use DNS over TLS
@pascalbaljet
pascalbaljet / imagick-3.4.0-PHP7-forge.sh
Last active November 26, 2020 09:10
Install Imagick 3.4.0 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz
@felipesere
felipesere / deploy.sh
Created October 19, 2015 23:27
Deploying form Circle-CI to AWS- ECS
#!/bin/bash
aws --version
aws configure set default.region us-west-2
aws configure set default.output json
echo "preparing task definition"
aws ecs describe-task-definition --task-definition applications | ./jq --arg x $CIRCLE_SHA1 ' .taskDefinition
| del(.status)
| del(.taskDefinitionArn)
@paulirish
paulirish / what-forces-layout.md
Last active April 19, 2024 14:42
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
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@calbrecht
calbrecht / PhpStormVagrantPhpUnit.php
Last active December 24, 2015 06:59
Run PhpUnit from wihtin PhpStorm through vagrant on virtual machine. Use this file as Custom Loader. See http://www.jetbrains.com/phpstorm/webhelp/phpunit.html
<?php
/** Full path to project dir on host */
isset($_SERVER['HOST_DIR']) or $_SERVER['HOST_DIR'] = realpath(__DIR__ . '/../../');
/** Full path to vagrant directory on host */
$_SERVER['VAGRANT_DIR'] = $_SERVER['HOST_DIR'] . '/vagrant';
/** Full path to project dir on virtual machine */
$_SERVER['GUEST_DIR'] = '/path/to/project/on/vm';
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@slickplaid
slickplaid / install_wkhtmltopdf.sh
Last active September 11, 2022 12:51
How to install version 0.12.0 (latest as of 5/10/13) of wkhtmltopdf on Ubuntu 12.04 LTS headless server.
sudo apt-get update && sudo apt-get upgrade -y;
sudo apt-get build-dep -y libqt4-gui libqt4-network libqt4-webkit;
sudo apt-get install -y openssl build-essential xorg git git-core libssl-dev libxrender-dev t1-xfree86-nonfree xfonts-scalable ttf-ubuntu-font-family ttf-mscorefonts-installer poppler-utils libqt4-dev qt4-dev-tools;
cd ~;
git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt;
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf;
cd wkhtmltopdf;
qmake-qt4;
cd ../wkhtmltopdf-qt;
git checkout 4.8.4;
@ezhuravlev
ezhuravlev / CentOS chkconfig script headers
Last active December 8, 2021 16:05
service <servicename> does not support chkconfig (CentOS)
/etc/init.d/<servicename>:
# chkconfig: 345 20 80
# description: my service
345 - 3,4,5 runlevels
20 - start priority
80- stop prioroty
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: