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
const puppeteer = require('puppeteer');
const firebase = require('firebase');
if(!firebase.apps.length) {
let config = {
apiKey: "xxxxxxxxxxxxxxxxxxxxx",
authDomain: "xxxxxxxxxxxxxxxxxxxxxxxx",
databaseURL: "xxxxxxxxxxxxxxxxxxxxx",
projectId: "xxxxxxxxx",
storageBucket: "xxxxxxxxxxxxxxxxxxxx",
function makeResizableDiv(div) {
const element = document.querySelector(div);
const resizers = document.querySelectorAll(div + ' .resizer')
for (let i = 0;i < resizers.length; i++) {
const currentResizer = resizers[i];
currentResizer.addEventListener('mousedown', function(e) {
currentResizer.addEventListener('mousemove', resize)
})
function resize(e) {
function makeResizableDiv(div) {
const element = document.querySelector(div);
const resizers = document.querySelectorAll(div + ' .resizer')
for (let i = 0;i < resizers.length; i++) {
const currentResizer = resizers[i];
currentResizer.addEventListener('mousedown', function(e) {
e.preventDefault()
window.addEventListener('mousemove', resize)
window.addEventListener('mouseup', stopResize)
})
@import url('https://fonts.googleapis.com/css?family=Lato');
* {
box-sizing: border-box;
font-family: 'Lato', sans-serif;
}
.autocomplete-search-box {
width: 50%;
margin-left: 25%;
import {Command} from '@oclif/command'
export default class Add extends Command {
static description = 'Add new todo to list'
static args = [{name: 'todo'}]
async run() {
const {args} = this.parse(Add)
const todo = args.todo
import {Command} from '@oclif/command'
import chalk from 'chalk'
export default class Add extends Command {
static description = 'Add new todo to list'
static args = [{name: 'todo'}]
async run() {
const {args} = this.parse(Add)
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;
}
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 {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 Remove extends Command {
static description = 'Remove a todo from list'
static args = [{name: 'index'}]
async run() {