Skip to content

Instantly share code, notes, and snippets.

View andremsantos's full-sized avatar

André Santos andremsantos

  • Docinho de Açucar
  • Portugal
View GitHub Profile
@andremsantos
andremsantos / php-docker-ext
Created September 11, 2022 22:15 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@andremsantos
andremsantos / valet-plus-destroy
Created November 19, 2019 23:26 — forked from dannygsmith/valet-plus-destroy
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@andremsantos
andremsantos / tailwindcss-colors-css-variables.css
Last active April 19, 2024 18:54
Tailwindcss colors in css variables
/* source: https://tailwindcss.com/docs/customizing-colors/#default-color-palette */
:root {
--black: #000000;
--white: #ffffff;
--gray-100: #f7fafc;
--gray-200: #edf2f7;
--gray-300: #e2e8f0;
--gray-400: #cbd5e0;
@andremsantos
andremsantos / default
Created October 25, 2019 23:32 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@andremsantos
andremsantos / Dockerfile
Created March 19, 2019 15:25 — forked from AkimaLunar/Dockerfile
Node.js 8 and NPM 5 on Ubuntu 16.04 Xenial Dockerfile
# Use an official Ubuntu Xenial as a parent image
FROM ubuntu:16.04
# Install Node.js 8 and npm 5
RUN apt-get update
RUN apt-get -qq update
RUN apt-get install -y build-essential
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN apt-get install -y nodejs
@andremsantos
andremsantos / MySQL_5-7_macOS.md
Created September 15, 2018 11:01 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@andremsantos
andremsantos / es6-compose.md
Created March 22, 2018 09:12 — forked from JamieMason/es6-compose.md
ES6 JavaScript compose function

ES6 JavaScript Compose Function

Definition

const compose = (...fns) =>
  fns.reverse().reduce((prevFn, nextFn) =>
    value => nextFn(prevFn(value)),
    value => value
 );
@andremsantos
andremsantos / deployUser.md
Created July 12, 2017 21:42 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@andremsantos
andremsantos / knex-pagination.js
Last active March 4, 2022 12:36
Adding pagination to knex.js
module.exports = function(dbConfig) {
var knex = require('knex')(dbConfig);
var KnexQueryBuilder = require('knex/lib/query/builder');
KnexQueryBuilder.prototype.paginate = function (per_page, current_page) {
var pagination = {};
var per_page = per_page || 10;
var page = current_page || 1;
if (page < 1) page = 1;
@andremsantos
andremsantos / git-reset
Created August 26, 2014 15:11
Reset all changes after last commit in git
#First reset the changes
git reset HEAD --hard
#then clean out everything untracked
git clean -fd
#source: http://stackoverflow.com/questions/4630312/reset-all-changes-after-last-commit-in-git