Skip to content

Instantly share code, notes, and snippets.

@dungphanxuan
dungphanxuan / Yii2VnLocation.md
Last active December 15, 2017 02:57
Học lập trình Yii 2 - Hướng dẫn tích hợp thư viện Yii 2 VN Location
@dungphanxuan
dungphanxuan / yii2-froala-widget.md
Last active August 23, 2017 03:59
Yii2 Froala Editor Widget

Config example for Yii 2 Froala Widget

Usage with ActiveForm and model

View

<?php
    echo $form->field($model, 'body')->widget(
        \froala\froalaeditor\FroalaEditorWidget::className(),
@dungphanxuan
dungphanxuan / GitHelper
Created December 2, 2016 01:34
Git helper
Document useful
https://help.github.com/articles/syncing-a-fork/
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
<!doctype>
<html>
<head>
</head>
<body>
<?php
require_once "Classes/PHPExcel.php";
$tmpfname = "test.xlsx";
@dungphanxuan
dungphanxuan / convDate2.php
Created September 5, 2016 04:44 — forked from kazua/convDate2.php
PHPで西暦⇔和暦変換
<?php
//write kazua
function convGtJDate($src) {
list($year, $month, $day) = explode('/', $src);
if (!@checkdate($month, $day, $year) || $year < 1869 || strlen($year) !== 4
|| strlen($month) !== 2 || strlen($day) !== 2) return false;
$date = str_replace('/', '', $src);
if ($date >= 19890108) {
$gengo = '平成';
@dungphanxuan
dungphanxuan / gist:1bf4c5547fdd0b4f28b1
Created March 22, 2016 09:41 — forked from thachpham92/gist:d57b18cf02e3550acdb5
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
@dungphanxuan
dungphanxuan / couchbase.md
Last active February 26, 2016 04:50
CouchBase Snippet

View example

 function (doc, meta) {
  emit([key], doc);
}

Query example

 $skip = 0;
@dungphanxuan
dungphanxuan / Yii2-Snippets.md
Last active August 28, 2017 08:44
Yii2 Snippets