Skip to content

Instantly share code, notes, and snippets.

View hungtrungthinh's full-sized avatar
🤒
Out sick

Thinh Nguyen hungtrungthinh

🤒
Out sick
View GitHub Profile
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../smoothie-chart/smoothie-chart.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@hungtrungthinh
hungtrungthinh / designer.html
Last active August 29, 2015 14:19
designer
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
#core_menu {
font-size: 16px;
left: 390px;
@hungtrungthinh
hungtrungthinh / mail-test.php
Created March 10, 2016 18:14 — forked from Dreyer/mail-test.php
Quick & Dirty PHP Mail Test Script
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
@hungtrungthinh
hungtrungthinh / local.xml
Created May 26, 2016 10:27 — forked from Maksold/local.xml
Magento XML - local.xml boilerplate
<?xml version="1.0"?>
<layout>
<default>
<!--Root/Default Layouts-->
<reference name="root">
<!--Appending Block-->
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</reference>
<!--CSS and JS Files-->
@hungtrungthinh
hungtrungthinh / functions.php
Created August 18, 2016 09:20
Store GET variables for UTM-vars in a cookie and replace them in form content.
<?php
// store {utm_campaign}, {utm_source} and {utm_medium} vars in cookies
add_action( 'init', function() {
$keys = array( 'utm_source', 'utm_medium', 'utm_campaign' );
foreach( $keys as $key ) {
if( ! empty( $_GET[ $key ] ) ) {
$value = (string) $_GET[ $key ];
setcookie( $key, $value, time()+3600, '/');
}
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@hungtrungthinh
hungtrungthinh / wp_custom_title_placeholder_text.php
Created May 21, 2017 17:16 — forked from isGabe/wp_custom_title_placeholder_text.php
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
<?php
/**
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info()
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems.
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento
* @author Magento Inc.
*/
PATH_TO_MAGENTO='/path/to/magento/installation/folder'
GITHUB_TOKEN='github-token-here'
MAGENTO_USER='your-key-here'
MAGENTO_PASS='your-pass-here'
MAGENTO_ADMIN_URL='http://your-server.com'
MAGENTO_ADMIN_USER='admin'
MAGENTO_ADMIN_PASS='admin123'
# ondrej best php apt-repository for php to be able to
# update and install PHP as needed
@hungtrungthinh
hungtrungthinh / m2-installer.sh
Created May 27, 2018 11:25 — forked from MagePsycho/m2-installer.sh
Magento 2 Installer - Bash Script
#!/usr/bin/env bash
#
# Script to install Magento2
#
# @author Raj KB <magepsycho@gmail.com>
# @website http://www.magepsycho.com
# @version 0.1.0
# UnComment it if bash is lower than 4.x version