Skip to content

Instantly share code, notes, and snippets.

View ricardoaguiar's full-sized avatar
🎯
Focusing

ricardo ricardoaguiar

🎯
Focusing
View GitHub Profile
@ricardoaguiar
ricardoaguiar / ApacheHTTPSConfig.md
Created January 27, 2019 09:41 — forked from nrollr/ApacheHTTPSConfig.md
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@ricardoaguiar
ricardoaguiar / php_apache_homebrew.md
Created January 27, 2019 10:41 — forked from DragonBe/php_apache_homebrew.md
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

@ricardoaguiar
ricardoaguiar / how-to-set-up-stress-free-ssl-on-os-x.md
Created February 2, 2019 09:04 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@ricardoaguiar
ricardoaguiar / dnsmasq OS X.md
Created February 13, 2019 14:06 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

NOTE this has been done properly by a guy here: https://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/

You should go and do that now, ignore all of this.

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

@ricardoaguiar
ricardoaguiar / .bash_profile
Created November 4, 2019 15:41 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@ricardoaguiar
ricardoaguiar / Install and uninstall dnsmasq.md
Created April 15, 2020 16:43
Install and uninstall dnsmasq #Dnsmasq #TipsTricks

Install

  1. brew install dnsmasq
  2. cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf now this is automatically done by the dnsmasq installation
  3. Replace this in /usr/local/etc/dnsmasq.conf file:
address=/test/127.0.0.1
listen-address=127.0.0.1
  1. sudo mkdir -v /etc/resolver
  2. sudo touch /etc/resolver/test
@ricardoaguiar
ricardoaguiar / brew-dnsmasq.md
Created April 26, 2020 06:37 — forked from davebarnwell/brew-dnsmasq.md
install dnsmasq with brew

Install dnsmasq and configure for *.dev.local domains

$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf

Reload configuration and clear cache

# Copy the daemon configuration file into place.
$ sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/

$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

@ricardoaguiar
ricardoaguiar / MeshCustomMaterial.js
Created July 2, 2020 19:22 — forked from mattdesl/MeshCustomMaterial.js
Custom mesh standard material with glslify + ThreeJS r83dev
const glslify = require('glslify');
const path = require('path');
// This is the original source, we will copy + paste it for our own GLSL
// const vertexShader = THREE.ShaderChunk.meshphysical_vert;
// const fragmentShader = THREE.ShaderChunk.meshphysical_frag;
// Our custom shaders
const fragmentShader = glslify(path.resolve(__dirname, 'standard.frag'));
const vertexShader = glslify(path.resolve(__dirname, 'standard.vert'));
@ricardoaguiar
ricardoaguiar / app.js
Created December 12, 2020 17:16
Talking to a remote mysql database using node.js
//
// Hacked together from http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/
//
var Client = require('mysql').Client;
var client = new Client();
client.host ='some.host.com';
client.user = 'user';
client.password = 'password';
console.log("connecting...");