Skip to content

Instantly share code, notes, and snippets.

View re4388's full-sized avatar
🎯
Focusing

re4388 re4388

🎯
Focusing
  • Taipei,Taiwan
View GitHub Profile
@re4388
re4388 / dialog_train.py
Created July 29, 2020 06:30
muen_desktop_maia
from PyQt5.QtCore import *
from maia.views.dialog_train_ui import Ui_dialogTrain
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import numpy as np
import os
import csv
#from gpuinfo import GPUInfo
import psutil
import time

Study On Web Security (pre-release)

  • A quick review of How Cookie Work

  • Site like SimilarWeb can track every website you visit, how?

    • They somehow can install spyware in your browsers through the browser tool you use, say Chrome Extension
    • ...
  • Basically, they know all the URL your browser send, they gather these URLS and save in their DB.

@re4388
re4388 / html-component
Created July 25, 2020 02:43
html-component
<mat-paginator #paginator
[length]="totalCount"
[pageIndex]="0"
[pageSize]="10"
[pageSizeOptions]="[5, 10, 15]">
</mat-paginator>
@re4388
re4388 / ngAfterViewInit2
Created July 25, 2020 02:43
ngAfterViewInit2
ngAfterViewInit() {
this.httpClient.get<any>('<https://api.github.com/search/issues?q=repo:angular/material2&page=1>').subscribe(data => {
this.totalCount = data.items.length;
this.emailsDataSource.data = data.items;
this.emailsDataSource.paginator = this.paginator;
});
}
@re4388
re4388 / ngAfterViewInit
Created July 25, 2020 02:42
前端處理和後端處理
 ngAfterViewInit() {
   this.httpClient.get<any>(`https://api.github.com/search/issues?q=repo:angular/material2&page=${this
    .currentPage.pageIndex + 1}`).subscribe(data => {
     this.totalCount = data.items.length;
     this.emailsDataSource.data = data.items;
       
     // no need below line anymore  
     // this.emailsDataSource.paginator = this.paginator;
  });
}
@re4388
re4388 / stock-avg-2317.csv
Created June 26, 2020 09:19
stock-avg-price-2317鴻海
year avgStockPrice
1991 65
1992 58.7
1993 48.6
1994 82.4
1995 94.1
1996 68.8
1997 179
1998 183
1999 202
@re4388
re4388 / brower-playground.markdown
Last active June 23, 2020 09:59
demo scrollHeight and scrolltop
@re4388
re4388 / curl-example.bash
Created June 21, 2020 10:22
curl-example
// POST reqest to add the first post
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"id\":\"1\",\"title\":\"this title\",\"text\":\"this is text\",\"categories\":\"cat\"}" \
http://localhost:3000/posts
// POST reqest to add the second post
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"id\":\"2\",\"title\":\"this second title\",\"text\":\"this is second text\",\"categories\":\"dog\"}" \
@re4388
re4388 / mysql-db-op
Last active June 21, 2020 10:05
mysql-db-op
// create database
create database mydb1;
// show databse
show databases;
// delete dn
drop databasae mydb1
// create database again
@re4388
re4388 / index.html
Created June 20, 2020 03:44
setTimeout
<body>
<form>
<input type="button" value="Run" onClick="timedCount()">
<input type="text" id="txt">
<input type="button" value="Stop" onClick="stopCount()">
</form>
</body>