Skip to content

Instantly share code, notes, and snippets.

View ZeroX-DG's full-sized avatar
💭
I may be slow to respond.

Nguyen Viet Hung ZeroX-DG

💭
I may be slow to respond.
View GitHub Profile
@ZeroX-DG
ZeroX-DG / token.rs
Created October 25, 2020 05:08
HTML tokenize states
#[derive(Clone, Debug)]
pub enum State {
Data,
CharacterReference,
TagOpen,
RCDATA,
RCDATALessThanSign,
RAWTEXT,
RAWTEXTLessThanSign,
ScriptData,
@ZeroX-DG
ZeroX-DG / webuild-best
Created August 7, 2020 00:08
Best of webuild
@huytd
06/08/2020 17:24:09
Tóm tắt lại mấy ý mấy ngày vừa qua mọi người thảo luận về chuyện hỏi làm sao để dễ nhận được câu trả lời:
1. Do your homework: Tự mình tìm hiểu trước khi hỏi
2. Show your homework: Cho mọi người thấy là bạn đã tìm hiểu nhưng vẫn không tìm được câu trả lời
3. Scope your question: Giới hạn phạm vi của câu hỏi, có thể chia nhỏ câu hỏi ra thành nhiều câu hỏi con, tránh hỏi khi bản thân bạn cũng chưa biết là mình muốn tìm kiếm điều gì từ câu hỏi đó, ví dụ: "có ai xài XYZ chưa, có thể chia sẻ một chút về kinh nghiệm xài cái này được không?"
4. Guess the answer: Thử đặt câu hỏi bằng cách đưa ra câu trả lời mà bạn nghĩ là đúng để xác minh kiến thức, ví dụ: "Em thấy Kipalog dạo này không có nhiều bài mới, có phải vì admin hết tiền làm quảng cáo không ạ?"
5. Không quạo: Nếu hỏi xong mà bị chửi thì cũng đừng tự ái mà hãy tìm cách xiên lại người chửi bạn một cách văn minh nhất.
Masculin Féminin (1966)
Boy (2010)
Lost in Translation (2003)
Madadayo (1993)
Cyclo (1995)
Band of Outsiders (1964)
Malèna (2000)
Lolita (1962)
Psycho (1960)
Interview with the Vampire (1994)
@ZeroX-DG
ZeroX-DG / loginFormDetective.py
Created July 14, 2019 22:07
Detect login forms
import requests
from lxml import html
input_rules = {
"type=password": 10,
"name=username": 10,
"name=password": 10,
"id=username": 10,
"id=password": 10,
"type=email": 5,
import {Command} from '@oclif/command'
import * as inquirer from 'inquirer'
import todoAPI from '../api/todoAPI'
export default class Interact extends Command {
static description = 'Enter the interacting mode'
async run() {
const source = todoAPI.list()
const choices = source // make a copy of the source
import {Command, flags} from '@oclif/command'
import chalk from 'chalk'
import todoAPI from '../api/todoAPI'
export default class Add extends Command {
static description = 'Add new todo to list'
static args = [{name: 'todo'}]
static flags = {
import {Command} from '@oclif/command'
import chalk from 'chalk'
import todoAPI from '../api/todoAPI'
export default class Remove extends Command {
static description = 'Remove a todo from list'
static args = [{name: 'index'}]
async run() {
import {Command} from '@oclif/command'
import todoAPI from '../api/todoAPI'
import chalk from 'chalk'
const Table = require('cli-table')
export default class List extends Command {
static description = 'Print out all todos'
async run() {
const table = new Table({
import {Command} from '@oclif/command'
import chalk from 'chalk'
import todoAPI from '../api/todoAPI'
export default class Add extends Command {
static description = 'Add new todo to list'
static args = [{name: 'todo'}]
async run() {
import * as fs from 'fs'
import * as path from 'path'
import * as os from 'os'
const todoFile = path.join(os.homedir(), 'checkme', 'todos.json')
interface Todo {
done: boolean;
todo: string;
}