Skip to content

Instantly share code, notes, and snippets.

View vuthaihoc's full-sized avatar
🤒
ke ke ặc ặc

Stupid Dev vuthaihoc

🤒
ke ke ặc ặc
View GitHub Profile
@vuthaihoc
vuthaihoc / trainee005_06.php
Created June 2, 2016 07:08
Bài 6 của HoanNC
<?php
header('Content-Type: text/html; charset=utf-8');
$value1 = isset($_POST['value1']) ? $_POST['value1'] : '';
$value2 = isset($_POST['value2']) ? $_POST['value2'] : '';
$result = 0;
$msg = "";
if(isset($_POST)){
if(is_numeric($value1) && is_numeric($value2)){
if(isset($_POST['add'])){
$result = $value1 + $value2;
@vuthaihoc
vuthaihoc / index.html
Created November 2, 2016 09:10 — forked from fcingolani/index.html
How to render a full PDF using Mozilla's pdf.js
<html>
<body>
<!-- really dirty! this is just a test drive ;) -->
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>
<script type="text/javascript">
function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1 };
@vuthaihoc
vuthaihoc / PageHelper.php
Last active July 1, 2017 03:17
Paginator sort link helper
<?php
/**
* Coding with 💚
* User: hocvt
* Date: 7/1/17
* Time: 08:55
*/
namespace App\Colombo;
<?php
/**
* Created by PhpStorm.
* User: hocvt
* Date: 6/6/17
* Time: 15:01
*/
namespace App\Colombo;
@vuthaihoc
vuthaihoc / SimpleRandom.php
Created August 7, 2017 07:06
Simple random item generator
<?php
/**
* Created by PhpStorm.
* User: hocvt
* Date: 8/7/17
* Time: 10:29
*/
namespace App\Colombo\Libs;

Source

Reasons for using design patterns

Introduction

Following on from a previous article entitled [Why design is Critical to Software Development][1], I would like to tackle a slightly more advanced aspect of software design called Design Patterns. As with my previous article, the idea came about during a discussion concerning the merits of software design with a work colleague. The protagonist of the discussion was of the opinion that Design Patterns are too time consuming to be of use within the field of commercial software development. My intention here is to demonstrate why I believe that to be wrong.

I will not go into any details about the mechanics or implementation of any particular Design Patterns. There are many excellent sources for these available elsewhere.

@vuthaihoc
vuthaihoc / What is dependency injection.md
Last active March 22, 2018 06:49
What is dependency injection and when/why should or shouldn't it be used?

What are common database development mistakes made by application developers?

source https://stackoverflow.com/questions/621884/database-development-mistakes-made-by-application-developers

1. Not using appropriate indices

This is a relatively easy one but still it happens all the time. Foreign keys should have indexes on them. If you're using a field in a 

WHERE you should (probably) have an index on it. Such indexes should often cover multiple columns based on the queries you need to execute.

Đoạn văn 1

Trong xu thế hội nhập của nền kinh tế Thế giới với nhiều cam go và thử thách, một nền kinh tế năng động và mang nhiều tính cạnh tranh, để bắt kịp nhịp độ phát triển chung ấy, Việt Nam đang cố gắng nỗ lực xây dụng mọi thứ về nhân lực và vật lực để có một nền tảng vững chắc cho phát triển kinh tế. Một trong những vấn đề mà Việt Nam cần phải chú trọng quan tâm đó là nguồn tài trợ. Vốn có vai trò hết sức quan trọng, nó là yếu tố không thế thiếu đối với từng doanh nghiệp. Để đáp ứng nhu cầu về vốn cho việc thực hiện các dự án đầu tư, các kế hoạch sản xuất kinh doanh, mỗi doanh nghiệp, tùy theo hình thức pháp lí, điều kiện của doanh nghiệp và cơ chế quản lí tài chính của các quốc gia có thể tìm kiếm những nguồn tài trợ nhất định. Tuy nhiên, mỗi nguồn tài trợ đều có những đặc điểm, chi phí khác nhau. Vì vậy, để giảm chi phí sử dụng vốn, nâng cao hiệu quả kinh doanh, ổn định tình hìn

Các hàm public của repository

// thêm từ khóa nếu chưa có, nếu có rồi thì cập nhật trust, không cập nhật source
$keyword_repository->creat($string, $source = 'manual', $trust = 1);
// lấy ra 10 từ khóa tìm được theo từ khóa cho trước
$keyword_repository->search($query, $page = 1; $limit = 10);
// sửa từ khóa
$keyword_repository->improve($old_keyword, $new_keyword, $source = 'manual', $trust = 1);
// Lấy ra danh sách