Skip to content

Instantly share code, notes, and snippets.

View henrytran9x's full-sized avatar

Henry Tran henrytran9x

View GitHub Profile
@henrytran9x
henrytran9x / wordpress.nginxconf
Created February 21, 2019 08:07 — forked from goblindegook/wordpress.nginxconf
Nginx virtual host configuration for WordPress
server {
listen 80;
server_name www.example.com;
rewrite ^ $scheme://example.com$request_uri?;
}
server {
listen 80;
server_name example.com;
#Steps taken to install Big Blue Button in CentOS 6
# we'll work mostly from the /tmp/ directory:
cd /tmp
# install MySQL server
yum install -y mysql-server
service mysqld start
chkconfig mysqld on
<?php
// ...
use Symfony\Component\HttpFoundation\Response;
// Then later on (inside your controller's class), you have a function used
// for the route_name (on a hook_menu() item in your .module file), this
// function can return a JSON response...
@henrytran9x
henrytran9x / gist:c2b72421656f5672bc280e1ed5349ea1
Created November 23, 2016 02:43 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@henrytran9x
henrytran9x / truncate-string-words.php
Created February 1, 2016 10:17 — forked from luizventurote/truncate-string-words.php
Truncate a string provided by the maximum limit without breaking a word.
<?php
/**
* truncate a string provided by the maximum limit without breaking a word
* @param string $str
* @param integer $maxlen
* @return string
*/
function truncateStringWords($str, $maxlen) {
if (strlen($str) <= $maxlen) return $str;
@henrytran9x
henrytran9x / reset.less
Created October 27, 2015 10:08 — forked from joshuapowell/reset.less
LESS: Global LESS CSS reset that gives elements default formatting.
/**
* Global Reset of all HTML Elements
*
* Resetting all of our HTML Elements ensures a smoother
* visual transition between browsers. If you don't believe me,
* try temporarily commenting out this block of code, then go
* and look at Mozilla versus Safari, both good browsers with
* a good implementation of CSS. The thing is, all browser CSS
* defaults are different and at the end of the day if visual
* consistency is what we're shooting for, then we need to
<?php
/**
* Theme_menu_tree doesn't provide any context information
* THIS SUCKS
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
*/
function MYTHEME_menu_tree(&$variables) {