text ipynb上传

USDTest.ipynb
onvert_exporter":"python","pygments_lexer":"ipython3","version":3}}

text 分享这个ShareThis

bc-share-this

Default share buttons Store settings > Share

https://sharethis.com/support/installation/install-share-buttons-bigcommerce/

text 将本地存储库推送到现有存储库

https://gist.github.com/alexpchin/102854243cd066f8b88e

add-local-repo-existing-one
git remote add origin <remote repository URL>

// maybe need to push -f

text 语义HTML

SEMANTIC HTML
SEMANTIC HTML
Review
Congrats on completing this lesson on Semantic HTML! Now that you know the benefits of Semantic HTML and how to use it, you can incorporate semantic elements into your website to make it more accessible and to make the code easier to read.

Let’s review some of the topics we covered throughout the lesson:

Semantic HTML introduces meaning to a page through specific elements that provide context as to what is in between the tags.
Semantic HTML is a modern standard and makes a website accessible for people who use screen readers to translate the webpage and improves your website’s SEO.
<header>, <nav> , <main> and <footer> create the basic structure of the webpage.
<section> defines elements in a document, such as chapters, headings, or any other area of the document with the same theme.
<article> holds content that makes sense on its own such as articles, blogs, comments, etc.
<aside> contains information that is related to the main content, but not required in order to understand the dominant information.
<figure> encapsulates all types of media.
<figcaption> is used to describe the media in <figure>.
<video>, <embed>, and <audio> elements are used for media files.

text 角形烤面包小吃吧

toast component
<i class="material-icons pullfloat-right" style="font-size: 18px;color: white" (click)="close()">close</i>
<div class="toast">
  <div class="toast-icon">
    <i class="far fa-times-circle" *ngIf="data?.type=='Error'"></i>
    <i class="far fa-check-circle" *ngIf="data?.type=='Success'"></i>
    <i class="fas fa-exclamation-triangle" *ngIf="data?.type=='Warning'"></i>
    <i class="fas fa-info-circle" *ngIf="data?.type=='Info'"></i>
  </div>
  <div class="toast-message">
    <div class="toast-title">{{data?.type}}</div>
    <div class="toast-content">{{data?.message}}</div>
  </div>
</div>
Toast component ts
import { Component, OnInit, Inject } from '@angular/core';
import { MAT_SNACK_BAR_DATA, MatSnackBar } from '@angular/material';

@Component({
  selector: 'app-toast',
  templateUrl: './toast.component.html',
  styleUrls: ['./toast.component.css']
})
export class ToastComponent implements OnInit {

  constructor(private snackBar: MatSnackBar,
    @Inject(MAT_SNACK_BAR_DATA) public data: any) { }

  ngOnInit() {
  }

  close():void{
    this.snackBar.dismiss();
  }
}
implement in service
  constructor(
        private http: Http, 
        private httpClient: HttpClient,
        private authService: AuthService,
        private snackBar: MatSnackBar
    ) { }
    
  implementToast = (message: string, type: 'Success' | 'Error' | 'Info' | 'Warning') => {
  this.snackBar.openFromComponent(ToastComponent, 
      {duration: 1500,
      data: { message: message, type: type },
      horizontalPosition: "right",
      verticalPosition: "top",
      panelClass: type + "Toast"});
    }

text 添加字体

添加字体

gistfile1.txt
@font-face {
font-family:font_strong;
src:url(‘../fonts/Captureit.ttf’) format(‘truetype’),
url(‘../fonts/Captureit.eot#iefix’) format(’embedded-opentype’),
url(‘../fonts/Captureit.woff’) format(‘woff’);
font-weight:normal;
 font-style:normal;
}



Giải thích code
Dòng đầu tiên: font-family:font_strong là tên mà ta muốn đặt cho font mình nhúng, bạn đặt tên như thế nào là tùy ý bạn.
Dòng thứ hai src:url(‘../fonts/Captureit.ttf’) đây là nguồn dẫn của font. Bạn chú ý 2 dấu chấm và thanh xuộc. Đường dẫn sai thì chắc chắn sẽ không lên cho nên phần này phải đặc biệt chú ý thật chính xác. format(‘truetype’) là định dạng của font, đuôi .ttf là truetype
Các dòng tiếp theo  url(‘../fonts/Captureit.eot#iefix’) format(’embedded-opentype’) url(‘../fonts/Captureit.woff’) format(‘woff’); cũng tương tự, chỉ khác đây là định dạng font khác. Nếu bạn chỉ có font .ttf thì chạy trên Google Chrome và FireFox thì được nhưng sẽ không chạy được trên IE. Để chạy được trên IE phải có font dạng .eot
font-weight:normal; font-style:normal; nghĩa là mình để font ở dạng thường (regular)
Vậy là xong, giờ ta dùng font cũng y như bình thường, nghĩa là chỗ nào cần dùng font nhúng ta khai báo font-family là tên font mà ta đã đặt vừa nãy là được, giả dụ giờ mình đặt các tiêu đề .title là font nhúng ở trên thì mình viết như sau trong CSS:

.title {
       font-family:font_strong;
}
Trình duyệt hỗ trợ
Tất cả các trình duyệt phổ thông gồm Chrome, FireFox, Opera, Safari và IE đều hỗ trợ nhúng font, tuy nhiên loại font mà chúng support thì có khác nhau.

Internet Explorer 9+, Firefox, Chrome, Safari và Opera hỗ trợ WOFF (Web Open Font Format) font.
Firefox, Chrome, Safari và Opera cũng hỗ trợ TTF (True Type Fonts) và OTF (OpenType Fonts).
Chrome, Safari và Opera hỗ trợ SVG fonts/shapes.
Internet Explorer hỗ trợ EOT (Embedded OpenType) fonts.
Nhúng font trực tuyến
Cái này vừa có điểm giống với @font-face mà cũng vừa khác nữa:
Giống ở chỗ, font sử dụng đều tải từ nơi khác về, và được dự trù là không có trên máy người dùng
Khác ở chỗ, @font-face là tải từ host của bạn, trong khi nhúng font trực tuyến thì tải từ server dịch vụ riêng
Hôm nay tôi sẽ giới thiệu với các bạn cách nhúng font bằng Google Font, ưu điểm:
Nhanh, đảm bảo: Vâng, vì nó là host của Google, nên tốc độ ổn định, hầu như không bị hỏng hóc, nên bạn có thể an tâm gần như 100%
Miễn phí: Bạn không phải mất tiền để sử dụng dịch vụ này. Thêm vào đó bạn cũng giúp giảm băng thông cho host của bạn
Đơn giản: Code nhúng của nó thậm chí còn đơn giản hơn @font-face. Kết quả demo bạn có thể xem ngay ở dưới.


Một số lưu ý:
Google Font có đến 3 kiểu nhúng: tiêu chuẩn là kiểu link ở trên, thứ hai là @import và cuối cùng là dùng JavaScript – cả 3 đều cho kết quả tương đương nhau, nhưng kiểu đầu tiên được khuyên dùng
Nếu muốn đồng bộ hóa font trên Google Font với Desktop hãy sử dụng tiện ích SkyFonts
Lời cuối: hãy thận trọng với nhúng font, đừng nhúng quá nhiều font khác nhau, vì nhúng font nghĩa là người dùng phải tải font về, nhúng các font quá nặng chắc chắn làm tăng thời gian tải trang, cái này là áp dụng chung chứ không riêng gì cho Google Font
Trả lời câu hỏi phụ (Mà cũng có khi là chính)
Tôi có thể tìm font độc và lạ ở đâu? => Trên mạng có rất nhiều trang web cung cấp font miễn phí cho phép bạn tải về. Bạn không nên tải font có phí bất hợp pháp vì nó có thể làm ảnh hưởng rất xấu đến trang web của bạn nếu chủ sở hữu font khởi kiện. Nhiều font miễn phí chất lượng tương đương thì tội gì chúng ta tải lậu đúng không ạ? Bạn có thể vào trang http://www.dafont.com/ để tìm font ưa thích nhé.
Font đẹp cho tiếng Việt có nhiều không? => Đáng tiếc là không! Bạn có khá ít lựa chọn độc đáo với tiếng Việt. Ở phía ngược lại, tiếng Anh và các ngôn ngữ châu Âu nói chung lại rất phong phú.
Tại sao tôi nhúng mãi font mà chẳng được, trình duyệt lởm rồi, bực mình quá! => Bạn nên dùng Google Chrome hoặc FireFox để kiểm tra nhúng thành công hay chưa. Cả 2 trình duyệt này mà không thành công thì là tại bạn nhúng sai chứ không phải tại trình duyệt. Lỗi không nhúng được font, 10 người thì 9 người là do sai đường dẫn ở cái src: url(‘đường dẫn font’). Nếu Font nhúng để cùng cấp với file HTML đường dẫn sẽ khác với Font nhúng bạn để ở trong thư mục Font riêng. Mình từng bị rồi, không biết thế là loay hoay cả tiếng!
Tôi có mỗi font định dạng .ttf, làm sao để tôi có định dạng .eot cho ông bạn IE bây giờ? => Giống như video có thể chuyển đổi (convert) định dạng, font cũng vậy. Bạn có thể search trên mạng hoặc vô trang này để chuyển đổi: http://www.fontsquirrel.com/tools/webfont-generator
Tôi thấy vài font rất đẹp trên một số trang web, tôi muốn dùng mấy font đó nhưng không biết thông tin về nó, vậy tôi phải làm gì? => Để tìm một font nào đó thì cách đơn giản nhất là biết tên của font, rồi google để tải về. Có một tiện ích mở rộng cho trình duyệt Google Chrome tên là WhatFont giúp bạn làm được điều đó. Địa chỉ ở đây. Cách sử dụng rất đơn giản, bạn chỉ cần di chuột qua chữ cần biết font, nó sẽ thông báo tên font cho bạn, ngoài ra bạn sẽ biết thêm các thông tin khác như kích cỡ, line height và màu chữ đang dùng.

text 找不到ID为primary的连接池。带有rails 5的sqlite3错误

No connection pool with id primary found. Error sqlite3 with rails 5
add 
gem 'sqlite3', '~> 1.3.6' 
to gemfile then run 
bundle update

text Android备注

notes
AndroidManifest.xml     =       Binds together all Resources, Activities, Layouts, etc.

Main_Activity.xml       =       Defines the first Activity

res folder              =       Contains visual and other resources that we can use in programs

java folder             =       Java Code

activity_main           =       Layout of First Activity

text 一些红宝石的di​​monstration

some ruby dimonstration
class Order
  TABLE_TAX = { 'TG' => 45, 'CB' => 22, 'RT' => 28 }

  attr_reader :email, :total, :status, :state

  def initialize(email, state, total, status = :pending)
    @email = email
    @state = state
    @total = total
    @status = status
  end

  def tax
    total * TABLE_TAX[state]
  end

  def to_s
    "#{email} (#{state}): $#{total} - #{status}"
  end

end


orders = []
orders << Order.new('customer1@gmail.com', 'TG', 300)
orders << Order.new('customer1@gmail.com', 'CB', 400,:completed)
orders << Order.new('customer1@gmail.com', 'RT', 100)

big_orders = orders.select do |o|
    o.total >= 300 
end

small_orders = orders.reject {|o| o.total >= 300 }

completed_orders = orders.detect { |o| o.status == :pending }

puts "--- big orders -----"
puts big_orders 
puts "--- all orders -----"
puts orders
puts "--- completed orders -----"
puts completed_orders
puts "--- small orders -----"
puts small_orders

text Configurar multiplos usuarios Git para um mesmo computador

git_multiplo
Uma outra forma é você configurar duas chaves ssh, dessa forma você pode usar um único usuário no computador.

Você efetua o clone em diretórios diferentes e ao fazer o push em cada diretório você estará utilizando uma conta diferente.

Para isso você deve criar uma nova chave ssh.

ssh-keygen -t rsa -C "email@segundaconta.com"

Ao executar esse comando será exibido algumas mensagens e será solicitado que você selecione o diretório que será gerado sua chave ssh: Enter file in which to save the key (/Users/SeuUsuario/.ssh/id_rsa).

Nesse momento você deve especificar um novo nome para o arquivo (do contrário será substituído o já existente), você pode especificar algo assim: /Users/SeusUsuario/.ssh/id_rsa_segundousuario.

Faz o processo normal para vincular a chave pública dessa chave ssh com o segundo usuário.

Dessa forma agora você tem duas chaves ssh mas precisa configurar quando deve ser usada cada uma delas.

Crie um arquivo com o nome config dentro do diretório ~/.ssh com um conteúdo mais ou menos assim.

#Default Github Account
Host github.com
 HostName github.com
 User git
 IdentityFile ~/.ssh/id_rsa

#Second Github Acount
Host github-second
 HostName github.com
 User git
 IdentityFile ~/.ssh/id_rsa_segundousuario
Agora imagine que temos o seguinte repositório para clonarmos git@github.com:SeuUsuario/teste.git.

posso usar um dos dois Host que tem no arquivo ~/.ssh/config.

Ao usar git clone git@github.com:SeuUsuario/teste.git estarei usando minha conta padrão.

Para usar a segunda conta basta mudar o host do repositório: git clone git@github-second:SeuUsuario/teste.git.

No diretório do segundo usuário talvez seja necessário configurar user.name e user.email.

git config --add user.name "Segundo Usuario"
git config --add user.email email@segundaconta.com

Fonte: https://cursos.alura.com.br/forum/topico-utilizar-usuarios-distintos-no-mesmo-computador-local-para-colaborar-no-git-26002