Skip to main content

Posts

Showing posts with the label HTML

Notes on regex sed, bash DOM html, meta tag

Using bash tool sed, awk, grep, vim ... to edit multiple file. Case study DOM tag <html DOCTYPE, meta, charset... https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string Sed cheatsheet https://gist.github.com/asenchi/2291903 HTML meta tags (recommend way ?) https://www.quackit.com/html_5/tags/html_meta_tag.cfm Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml " xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html" charset="EUC-JP" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="description" content="content here" ...

Một số kinh nghiệm phỏng vấn Web Developer - PHP

Diamond problem (ambiguous in inheritance) https://stackoverflow.com/questions/2064880/diamond-problem Class A, Class B some method here ... print A method, B method ... Question what output and why ? ... If we want class B method print A's method output ... => how to do that ? define final static self accept static method, properties. $this can not.... see more here :   https://www.wisdomjobs.com/e-university/object-oriented-programming-in-php-interview-questions.html SQL design Product, Orders, query best sell each month ... In PHP, Overloading is possible http://200-530.blogspot.in/2013/04/oop-magic-methods.html

JS 2

var canSaveCookie = (function () { $.cookie("testSaveCookie", {}); var ok = $.cookie("testSaveCookie") !== null; $.removeCookie("testSaveCookie"); return ok; })(); function addTaskList(project_management_id, date) { $.ajax({ url: "<?= Yii::$app->request->baseUrl ?>/task-detail/ajax-list-task", dataType: 'json', data: {'project_management_id' :project_management_id, 'ask_date': date}, type: 'POST', success: function (res) { tasks = JSON.parse(res.items); // defaultEventClick(tasks[0]); console.log(tasks.length); // avoid duplicate append task list clearPopupTaskList(); $.each(tasks, function(id, value) {     $('#popup_task_id')        .append($("<option></option>")        .attr("value", value['id'])        .text(value['task_name'])); }); defa...

Some Source code used often.

Mobile-Detect. Use simple code below: include 'Mobile_Detect.php'; $detect = new Mobile_Detect(); // Check for any mobile device. if ($detect->isMobile()) // mobile content else // other content for desktops Source code download here: Mobile Detect In Javascript, there are many script or lib to do this. Here one of mine: @extends('layouts.main') @section('head') @stop @section('content') login!! Facebook or Youtube login 【Sample CHECK!】 login!! screen 13 screen 15 screen 14 Some msg 3-12-12 笹川記念会館 Copyright ©C Official Web All rights reserved. @stop @section('script') @stop My script above is one of my index page. It write in Laravel bl...