- brew unlink php71
- brew unlink php@7.1
- brew list | grep php | while read x; do brew uninstall --force $x; done
- rm -rf /usr/local/Cellar/php
- rm -rf /usr/local/Cellar/php71/
- sudo rm -rf /usr/local/Cellar/php71/
- sudo rm -rf /usr/local/Cellar/php71
- sudo rm -rf ~/Library/LaunchAgents/homebrew.mxcl.php*
- sudo rm -rf /Library/LaunchDaemons/homebrew.mxcl.php*
<?php | |
// API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = array( $_GET['id'] ); | |
// prep the bundle | |
$msg = array |
Workbox runtime caching recipes
Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:
importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();
// Placeholder array populated automatically by workboxBuild.injectManifest()
This driver requires the Microsoft Visual C++ Redistributable. The redistributable can easily be downloaded on the Microsoft website as x86 or x64 edition. Notice: On a x64 computer the x86 AND the x64 version must be installed.
Source: http://www.syahzul.com/2016/04/06/how-to-install-oci8-on-ubuntu-14-04-and-php-5-6/
Download the Oracle Instant Client and SDK from Oracle website. (Need to login in Oracle page)
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Another alternative to installing Go is to use a simple Bash script. It will download and install Go language under of your own user account.
Note that a system-wide installation might be better for some things (for example, better protected from accidental modifications etc.), but this was a bit simpler to setup.
For this example, we are using:
package main | |
import ( | |
"log" | |
"net" | |
"strconv" | |
"strings" | |
) | |
const ( |
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks | |
# of the ActiveRecord pattern. Several apps I have seen, and several | |
# developers I have spoken to are looking towards other patterns for object | |
# persistence. The major drawback with ActiveRecord is that the notion | |
# of the domain object is conflated with what it means to store/retrieve | |
# it in any given format (like sql, json, key/value, etc). | |
# | |
# This is an attempt to codify the Repository pattern in a way that would | |
# feel comfortable to beginner and seasoned Ruby developers alike. | |
# |
Recently I was asked to generate PDF invoices for an online shop. I looked at various PHP PDF generators, but wasn't particularly impressed with any of them.
Then I found (via Stack Overflow) a command-line HTML-to-PDF convertor called wkhtmltopdf, which uses WebKit (the same layout engine as Safari and Google Chrome) and therefore is very accurate.
There is a class for PHP integration on the Wiki, but I found it overly complicated and it uses temp files which aren't necessary. This is the code I wrote instead.
I used Smarty for generating the HTML for the PDF, but you can use any template engine, or pure PHP if you prefer.
Note: I originally tried to install wkhtmltopdf from source, but it's much easier to use the static binary instead.