Skip to content

Instantly share code, notes, and snippets.

View mrtonyhuynh's full-sized avatar
😇
Nice & Professional

Tony Huỳnh mrtonyhuynh

😇
Nice & Professional
View GitHub Profile
Hello!
Basic installed stuff:
- PHP (5.5.12) (see http://localhost/info.php)
- Node (0.12.2)
- MySql (5.5.41)
- Phalcon (2.0.0)
- PostgreSQL
- Mongo
- Android development environment (note that you cannot actually run android vm inside this vm, darn... I'll try to figure out this though)
@mrtonyhuynh
mrtonyhuynh / API
Last active February 27, 2016 03:30 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs
1. Count social sharing from API
@mrtonyhuynh
mrtonyhuynh / gist:35681731db3abda06e8c
Created March 28, 2016 03:13 — forked from nathanjohnson320/gist:7283784
Use the Google Places API with node.js
exports.randeats = function(req, res){
var key = req.query.key;
var location = encodeURIComponent(req.query.location);
var radius = 16000;
var sensor = false;
var types = "restaurant";
var keyword = "fast";
var https = require('https');
var url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?" + "key=" + key + "&location=" + location + "&radius=" + radius + "&sensor=" + sensor + "&types=" + types + "&keyword=" + keyword;
@mrtonyhuynh
mrtonyhuynh / viewport.js
Created May 27, 2016 02:27 — forked from bohman/viewport.js
jQuery get viewport size
// -----------
// Debugger that shows view port size. Helps when making responsive designs.
// -----------
function showViewPortSize(display) {
if(display) {
var height = jQuery(window).height();
var width = jQuery(window).width();
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>');
jQuery(window).resize(function() {
@mrtonyhuynh
mrtonyhuynh / custom-social-share.html
Created December 16, 2016 03:31
Custom Social Share Button with Callback
<html>
<head>
<title>Social Share</title>
</head>
<body>
<h2>Custom Social Share Button with Callback</h2>
<button id="share-facebook">Share on Facebook</button>
<button id="share-twitter">Share on Twitter</button>
@mrtonyhuynh
mrtonyhuynh / wp-config.php
Created December 4, 2017 13:55 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
// Explicitely setting url
define( 'WP_HOME', 'http://domain.com' );
define( 'WP_SITEURL', 'http://domain.com' );
// Set url to... whatever.
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] );

SCSS

Cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the awesome CSS extensions you've always wished you had:

  • [Nested selectors
@mrtonyhuynh
mrtonyhuynh / php-style-guide.md
Created June 27, 2018 08:27 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@mrtonyhuynh
mrtonyhuynh / _ec2-lightsail-amazon-linux-nginx-apache-proxy-php-7.md
Created July 14, 2018 02:30 — forked from irman/_ec2-lightsail-amazon-linux-nginx-apache-proxy-php-7.md
Setting up Nginx-Apache Reverse Proxy, PHP, & MariaDB with SSL on EC2/Lightsail with Amazon Linux

Setting up Nginx-Apache Reverse Proxy, PHP, & MariaDB with SSL on EC2/Lightsail with Amazon Linux

Final setup should consists of:

  1. NGINX (reverse proxy & static contents)
  2. Apache 2.4 (Dynamic content: PHP)
  3. PHP 7.1
  4. MariaDB 10.1

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.