Skip to content

Instantly share code, notes, and snippets.

@evansims
evansims / Dockerfile
Last active February 14, 2024 10:09
Dockerfile: php-fpm 7.4-fpm alpine w/ gd bz2 intl mbstring redis mongodb xdebug opcache
FROM php:7.4-fpm-alpine
WORKDIR "/application"
# Install essential build tools
RUN apk add --no-cache \
git \
yarn \
autoconf \
g++ \
make \
@ryderdamen
ryderdamen / gce-to-gcs-uploads.md
Created December 4, 2018 15:43
Uploading Files from Google Compute Engine (GCE) VMs to Google Cloud Storage (GCS)

Uploading Files from Google Compute Engine (GCE) VMs to Google Cloud Storage (GCS)

I had a bit of trouble trying to configure permissions to upload files from my Google Compute Engine instance to my Google Cloud Storage bucket. The process isn't as intuitive as you think. There are a few permissions issues that need to be configured before this can happen. Here are the steps I took to get things working.

Let's say you want to upload yourfile.txt to a GCS bucket from your virtual machine. You can use the gsutil command line tool that comes installed on all GCE instances.

If you've never used the gcloud or gsutil command line tools on this machine before, you will need to initialize them with a service account.

@dccampbell
dccampbell / PrintToPDF.php
Created October 1, 2018 07:08
Minimal PHP example of printing HTML to PDF using Headless Chrome
<?php
$chromeExec = 'google-chrome';
$inputFile = __DIR__.'/input.html';
$outputFile = __DIR__.'/output.pdf';
$version = shell_exec($chromeExec . ' --version 2>&1');
if(!strpos($version, 'Google Chrome') === 0) {
throw new Exception('Google Chrome not found at: '.$chromeExec);
@keithweaver
keithweaver / domain-to-aws-ec2-instance.md
Created March 20, 2017 23:49
Point Domain to Amazon Web Services (AWS) EC2 Instance

Point Domain to Amazon Web Services (AWS) EC2 Instance

  1. Open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.
  2. If you are new to Amazon Route 53, you see a welcome page; choose Get Started Now for DNS Management. Otherwise, choose Hosted Zones in the navigation pane.
  3. Choose Create Hosted Zone.
  4. For Domain Name, type your domain name.
  5. Choose Create.
  6. Click the Hosted Zone, edit record set.
  7. In the value, add ec2-54-152-134-146.compute-1.amazonaws.com.
  8. Change your DNS file to point to the IPv4 address (This would be in something like GoDaddy).

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@tuanpmt
tuanpmt / php7_build_ubuntu15.04.sh
Created December 4, 2015 07:32 — forked from m1st0/php_build_ubuntu.sh
Compiling PHP 7 on Ubuntu 15.04 with LDAP Support
#! /bin/bash
## PHP 7 Initial Compile ##
## Some help from the various places like these. ##
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
## Setup Ubuntu 15.04 ##
# I like the speed of Apt-Fast. Will check for installs some other day.
sudo apt-get install apt-fast
@m1st0
m1st0 / php_build_ubuntu.sh
Last active November 25, 2023 07:33
Compiling PHP 8 on Ubuntu 22.10 with Various Supported Modules
#!/bin/bash
# PHP 8 Compile #
# Author: Maulik Mistry
# Please share support: https://www.paypal.com/paypalme/m1st0
# References:
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
# root-talis https://gist.github.com/root-talis/40c4936bf0287237839ccd3fdfdaec28
#
@gubatron
gubatron / compiling_building_c_cpp_notes.md
Last active April 18, 2024 07:58
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015;

Last update on December 14, 2023

Updated on February 27, 2023

Updated August 29, 2019.

@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active April 25, 2024 14:08
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@joshmfrankel
joshmfrankel / fixBrokenHTMLString.php
Last active September 8, 2023 12:22
PHP: Fix broken html tags in string and use html entities
/**
* Fix for broken html tags inside strings for php.
*
* By using passing the html through DOMDocument and converting the html
* entities we are left with beautiful well formatted code. Huzzah!
*
* "Nothing is ever easy" -Zedd, Wizards First Rule
*
* @var DOMDocument
*/