Skip to content

Instantly share code, notes, and snippets.

View voduytuan's full-sized avatar

Vo Duy Tuan voduytuan

View GitHub Profile

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

@voduytuan
voduytuan / build.xml
Created September 19, 2015 05:18
Sample build.xml for apache Ant for php project
<?xml version="1.0" encoding="UTF-8"?>
<project name="Apitoy" default="full-build">
<!-- By default, we assume all tools to be on the $PATH -->
<property name="pdepend" value="/home/jenkins/vendor/bin/pdepend"/>
<property name="phpcpd" value="/home/jenkins/vendor/bin/phpcpd"/>
<property name="phpcs" value="/home/jenkins/vendor/bin/phpcs"/>
<property name="phploc" value="/home/jenkins/vendor/bin/phploc"/>
<property name="phpmd" value="/home/jenkins/vendor/bin/phpmd"/>
<property name="phpunit" value="/home/jenkins/vendor/bin/phpunit"/>
@voduytuan
voduytuan / build.phpunit.xml
Created September 19, 2015 05:20
Config for phpunit
<?xml version="1.0" encoding="UTF-8"?>
<phpunit>
<testsuites>
<testsuite name="Model">
<directory>tests/Model/</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
@voduytuan
voduytuan / build.phpmd.xml
Created September 19, 2015 05:21
Config xml for phpmd
<?xml version="1.0"?>
<ruleset name="Teamcrop"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Teamcrop's ruleset</description>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
@voduytuan
voduytuan / docker-compose.yml
Created October 6, 2015 09:23
Private docker registry compose
dockerauth:
image: cesanta/docker_auth
ports:
- "5001:5001"
volumes:
- ./auth_server/config:/config:ro
- ./auth_server/log:/logs
- ./certs:/certs
command: /config/auth_config.yml
restart: always
@voduytuan
voduytuan / auth_config.yml
Created October 6, 2015 09:27
Sample configuration for cesanta/docker_auth image
server:
addr: ":5001"
certificate: "/certs/domain.crt"
key: "/certs/domain.key"
token:
issuer: "Auth Service" # Must match issuer in the Registry config.
expiration: 900
users:
@voduytuan
voduytuan / haproxy.cfg
Created October 6, 2015 10:17
Sample pass through SSL on Haproxy
...
#create new frontend to process 443
frontend https_frontend
bind *:443
mode tcp
option tcplog
default_backend farm_docker2
@voduytuan
voduytuan / HRV_BZ_Just_For_Fun
Created October 16, 2015 17:13
Some domain of sale platform, just for fun
097320xxxx.com
1006appxxxx.com
185footmasxxxx.com
5xxxx.com
5giaysxxxx.com
7xxxx.com
9xxxx.com
ahaxxxx.com
anbanglinhfootmasxxxx.com
anhmixxxx.com
@voduytuan
voduytuan / build.js
Created April 24, 2016 02:33
Teamcrop Front-end Requirejs Optimizer build file
({
baseUrl: 'js/',
out: 'js/main-built.js',
/* DO NOT CHANGE THIS LINE (IT WILL BE USED BY GULP TASK TO GENERATE ALL MODULES FOR REQUREIJS) */
include: ['main', 'requireLib'],
/* DO NOT CHANGE ABOVE LINE */
//optimizeAllPluginResources: true,
fileExclusionRegExp: /^((r|build)\.js)$/,
@voduytuan
voduytuan / ses-receiving-lambda
Last active July 16, 2016 04:06
ses-receiving-lambda.js
'use strict';
let AWS = require('aws-sdk');
// We need this to build our post string
let http = require('http');
let fs = require('fs');
function makePostRequest(data) {
// Build the post string from an object
var post_data = JSON.stringify(data);