Skip to content

Instantly share code, notes, and snippets.

View minhlucvan's full-sized avatar
🏠
Working from home

Minh Luc Van minhlucvan

🏠
Working from home
View GitHub Profile
@minhlucvan
minhlucvan / dev-note
Last active October 28, 2016 16:52
note
# It can be better
# fake it when you take it
# turn off your wifi
# build for everyone
# do less, be lazy
@minhlucvan
minhlucvan / nerver.php
Last active December 25, 2016 13:35
nerver mind
<?php
class Button
{
public $text;
public $icon;
public $type;
public $link;
function __construct($text, $icon, $type, $link){
function parsePage( res ){
var $html = $(res);
var ul = $html.find('.mt30.recipe_box_list.recipe_box_list_all');
var lis = ul.children();
var mon = $.map(lis, function( li ){
var $li = $(li);
return {
url: 'http://www.amthuc365.vn/' + $li.find('a').first().attr('href'),
name: $li.find('a').first().attr('title'),
img: $li.find('a img').first().attr('src')
Array.prototype.mergeMap = function(arr, field){
var arr1 = this, arr2 = arr;
return arr1.map( function ( el1 ) {
var sameEl = arr2.find( function( el2 ){
return el2[field] == el1[field];
});
return Object.assign({}, el1, sameEl);
})
};
function changeAlias( alias ) {
if( !alias instanceof String ) return "";
return alias
.replace(/À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, "A")
.replace(/È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ/g, "E")
.replace(/Ì|Í|Ị|Ỉ|Ĩ/g, "I")
.replace(/Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ/g, "O")
.replace(/Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ/g, "U")
.replace(/Ỳ|Ý|Ỵ|Ỷ|Ỹ/g, "Y")
.replace(/Đ/g, "D")
<?php
// tot nhat nen láy ra từ db, them vai bang de lưu cac tieu chí va cách danh gia
private map_chu_de_from_diem = array(
'tong_hoc_tap' => array(
'tong_hoc_tap'
),
'tru_hoc_luc_yeu' => array(
'tru_hoc_luc_yeu'
)
);
(function (Phaser, spilgameads) {
if( !Phaser || !spilgameads){
console.warn("HHAdsPlugin require Phaser and spilgameads.");
}
var HHAdsPlugin = function (game, parent, option) {
Phaser.Plugin.call(this, game, parent);
this.events = new Phaser.Signal();
};