Skip to content

Instantly share code, notes, and snippets.

View phongtattuan's full-sized avatar

Phong Tat phongtattuan

View GitHub Profile
@phongtattuan
phongtattuan / GitCommitEmoji.md
Created October 30, 2017 03:13 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@phongtattuan
phongtattuan / README.md
Created October 30, 2017 03:12 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@phongtattuan
phongtattuan / setup-dev.sh
Last active August 29, 2015 14:26
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
<?php
interface SocialNetwork
{
public function getKey();
public function getShareCount($url);
}
class Twitter implements SocialNetwork
{
public function getKey()
function normalizeCount( count, missingResultText ) {
missingResultText = missingResultText || '';
var millionCharacter = 'M';
var thousandCharacter = 'K';
if( !count && count !== 0 ) {
return missingResultText;
}
function getRounded( num ) {
return ( num ).toFixed( 1 ).replace( /\.0/, '' );