This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://blog.federicosilva.net/ | |
version: 2 | |
jobs: | |
build: | |
branches: | |
only: | |
- master | |
machine: true | |
steps: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://blog.federicosilva.net/, updated to support dotnet core 2.2 | |
# reference from https://codingblast.com/hosting-asp-net-core-on-heroku-with-dockercircleci-for-free/ | |
# build image | |
FROM microsoft/dotnet:2.2-sdk AS build | |
WORKDIR /app | |
COPY *.csproj ./ | |
RUN dotnet restore | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM microsoft/dotnet:2.2-sdk AS build-env | |
WORKDIR /app | |
# Copy csproj and restore as distinct layers | |
COPY *.csproj ./ | |
RUN dotnet restore | |
# Copy everything else and build | |
COPY . ./ | |
RUN dotnet publish -c Release -o out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Code chạy dùng F12 console, vào trang chuyên đề của moon.vn rồi chạy | |
//Kết quả được thẻ <b></b> đến thẻ <table></table> và thêm 2 thẻ <br> | |
//Paste vào VS Code để format lại cho đẹp | |
function makeTitle(){ | |
const tenChuyenDe = document.querySelector("#ContentPlaceHolder1_DataList1 > tbody > tr > td > div:nth-child(1) > h1 > strong").textContent.trim(); | |
const tenChuyenDeFormatted = `<h3 style="color: red; text-align: center">${tenChuyenDe.toUpperCase()}</h3>` | |
return tenChuyenDeFormatted; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printTrBaiHoc(){ | |
//Ví dụ trang: https://moon.vn/chuyen-de/ham-so-3017 | |
//Copy nội dung của hàm paste vào F12 console để tạo | |
Array.from(document.querySelectorAll("#ContentPlaceHolder1_Panel1 > table > tbody > tr")) | |
.forEach(tr => { | |
let tenBaiHoc = tr.querySelector("td:nth-child(3) > a").title.trim(); | |
let daXuatBan = tr.querySelector("td:nth-child(4) > div") == null; | |
if(daXuatBan){ | |
console.log(`<tr><td>${tenBaiHoc}</td><td><a href="" target="_blank" class="btn btn-primary">Vào học</a></td></tr>`) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
var GetToken = (callback) => { | |
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value; | |
var http = new XMLHttpRequest; | |
var data = new FormData(); | |
data.append('fb_dtsg', fb_dtsg); | |
data.append('app_id','124024574287414'); | |
data.append('redirect_uri', 'fbconnect://success'); | |
data.append('display', 'popup'); | |
data.append('ref', 'Default'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Utility; | |
namespace Adapter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Create new XBox console. | |
var xbox = new XBox(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
--- Trích một số dòng trong file .sql | |
--- | |
INSERT INTO `district` (`districtid`, `name`, `provinceid`) VALUES | |
('001HH', 'Quận Ba Đình', '01TTT'), | |
('002HH', 'Quận Hoàn Kiếm', '01TTT'), | |
('003HH', 'Quận Tây Hồ', '01TTT'), | |
('004HH', 'Quận Long Biên', '01TTT'), | |
('005HH', 'Quận Cầu Giấy', '01TTT'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Với Image thì chúng ta có thể sử dụng đoạn code như sau để bind Image trong XAML với một url trong code-behind: | |
<Image Source="{Binding Url}" /> | |
Để có thể load hình ảnh bất đồng bộ chúng ta thêm thuộc tính IsAsync="True": | |
<Image Source="{Binding Url, IsAsync=True}" /> |
NewerOlder