Skip to content

Instantly share code, notes, and snippets.

import puppeteer from "puppeteer";
async function openWebPage() {
const browser = await puppeteer.launch({
headless: false,
slowMo: 200,
});
const page = await browser.newPage();
await page.goto("https://www.example.com");
await browser.close();
@fazt
fazt / docker-compose.yml
Created October 16, 2021 15:42
Postgres y PgAadmin4 en docker-compose
version: "3.8"
services:
postgres:
image: postgres
restart: always
environment:
- DATABASE_HOST=127.0.0.1
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
@fazt
fazt / TaskContract.sol
Created July 8, 2021 23:30
A CRUD Tasks contract
pragma solidity ^0.8.6;
contract TaskCrud {
struct Task {
uint id;
string name;
string description;
}
const request = require('request-promise');
const cheerio = require('cheerio');
const fs = require('fs-extra');
const writeStream = fs.createWriteStream('quotes.csv');
async function init() {
try {
// const response = await request('http://quotes.toscrape.com/');
const $ = await request({
from flask import Flask, request
from flask_restful import Resource, Api
from sqlalchemy import create_engine
from flask_jsonpify import jsonify
db_connect = create_engine('sqlite:///database.db')
app = Flask(__name__)
api = Api(app)
class Sellers(Resource):
@fazt
fazt / index.py
Created April 19, 2019 15:06
Python Simple Discord Bot
import discord
from discord.ext import commands
import datetime
from urllib import parse, request
import re
bot = commands.Bot(command_prefix='>', description="This is a Helper Bot")
@bot.command()
@fazt
fazt / all-angular-material-components-imports.txt
Created December 16, 2018 22:55 — forked from pimatco/all-angular-material-components-imports.txt
All Angular Material Components Imports from app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';
@fazt
fazt / init.vim
Created November 23, 2018 08:23
Neovim setup
call plug#begin('~/.vim/plugged')
" General Plugins
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'sheerun/vim-polyglot'
Plug 'jiangmiao/auto-pairs'
" Themes
@fazt
fazt / typescript-fast-course.ts
Created July 29, 2017 04:58
Snippets fro a fast typescript course
// you will learn
// error compilations types
console.log("hello world");
// Types
// string
let myString:string;
myString = "Hello" + "World";
myString = myString.slice(0,3);