From dea4a61cbf42ff422f1409d4342fa59017950526 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Mon, 2 Nov 2020 18:37:23 -0300 Subject: Changed theme to Archie, moving blog to rogs.me --- config.toml | 35 +- content/_index.md | 121 ++++++ content/posts.org | 208 ----------- ...cy-appointment-thanks-to-python-and-selenium.md | 2 +- ...ow-to-scrape-your-auth0-database-with-django.md | 270 ++++++++++++++ posts.org | 209 +++++++++++ static/avatar.png | Bin 207468 -> 220322 bytes themes/archie/.github/FUNDING.yml | 4 + themes/archie/LICENSE | 20 + themes/archie/README.md | 106 ++++++ themes/archie/archetypes/default.md | 2 + themes/archie/exampleSite/archetypes/default.md | 5 + themes/archie/exampleSite/config.toml | 48 +++ themes/archie/exampleSite/content/_index.md | 4 + themes/archie/exampleSite/content/about.md | 28 ++ themes/archie/exampleSite/content/archives.md | 5 + .../archie/exampleSite/content/homepage/about.md | 7 + .../archie/exampleSite/content/homepage/index.md | 3 + themes/archie/exampleSite/content/homepage/work.md | 7 + themes/archie/exampleSite/content/posts/post-1.md | 62 ++++ themes/archie/exampleSite/content/posts/post-2.md | 40 ++ themes/archie/exampleSite/content/posts/post-3.md | 38 ++ themes/archie/exampleSite/content/posts/post-4.md | 30 ++ themes/archie/exampleSite/content/posts/post-5.md | 75 ++++ themes/archie/exampleSite/content/posts/post-6.md | 36 ++ themes/archie/exampleSite/content/posts/post-7.md | 15 + themes/archie/exampleSite/content/posts/tg-gh.md | 382 +++++++++++++++++++ themes/archie/images/archie-dark.png | Bin 0 -> 109628 bytes themes/archie/images/screenshot.png | Bin 0 -> 207481 bytes themes/archie/images/theme.png | Bin 0 -> 128732 bytes themes/archie/images/tn.png | Bin 0 -> 63396 bytes themes/archie/layouts/404.html | 0 themes/archie/layouts/_default/baseof.html | 11 + themes/archie/layouts/_default/list.html | 17 + themes/archie/layouts/_default/single.html | 33 ++ themes/archie/layouts/_default/term.html | 17 + themes/archie/layouts/_default/terms.html | 20 + themes/archie/layouts/index.html | 21 ++ themes/archie/layouts/partials/footer.html | 42 +++ themes/archie/layouts/partials/head.html | 11 + themes/archie/layouts/partials/header.html | 66 ++++ themes/archie/layouts/partials/paginator.html | 15 + themes/archie/layouts/shortcodes/callout.html | 6 + themes/archie/static/css/dark.css | 163 +++++++++ themes/archie/static/css/fonts.css | 38 ++ themes/archie/static/css/main.css | 293 +++++++++++++++ .../static/fonts/fira-sans-v10-latin-regular.eot | Bin 0 -> 25059 bytes .../static/fonts/fira-sans-v10-latin-regular.svg | 330 +++++++++++++++++ .../static/fonts/fira-sans-v10-latin-regular.ttf | Bin 0 -> 54984 bytes .../static/fonts/fira-sans-v10-latin-regular.woff | Bin 0 -> 25888 bytes .../static/fonts/fira-sans-v10-latin-regular.woff2 | Bin 0 -> 21244 bytes .../fonts/ibm-plex-mono-v6-latin-500italic.eot | Bin 0 -> 17474 bytes .../fonts/ibm-plex-mono-v6-latin-500italic.svg | 365 +++++++++++++++++++ .../fonts/ibm-plex-mono-v6-latin-500italic.ttf | Bin 0 -> 40032 bytes .../fonts/ibm-plex-mono-v6-latin-500italic.woff | Bin 0 -> 19900 bytes .../fonts/ibm-plex-mono-v6-latin-500italic.woff2 | Bin 0 -> 15224 bytes .../static/fonts/roboto-mono-v12-latin-regular.eot | Bin 0 -> 13517 bytes .../static/fonts/roboto-mono-v12-latin-regular.svg | 405 +++++++++++++++++++++ .../static/fonts/roboto-mono-v12-latin-regular.ttf | Bin 0 -> 22224 bytes .../fonts/roboto-mono-v12-latin-regular.woff | Bin 0 -> 15160 bytes .../fonts/roboto-mono-v12-latin-regular.woff2 | Bin 0 -> 12312 bytes themes/archie/static/js/feather.min.js | 13 + themes/archie/static/js/main.js | 0 themes/archie/theme.toml | 15 + 64 files changed, 3421 insertions(+), 222 deletions(-) create mode 100644 content/_index.md delete mode 100644 content/posts.org create mode 100644 content/posts/how-to-scrape-your-auth0-database-with-django.md create mode 100644 posts.org create mode 100644 themes/archie/.github/FUNDING.yml create mode 100644 themes/archie/LICENSE create mode 100644 themes/archie/README.md create mode 100644 themes/archie/archetypes/default.md create mode 100644 themes/archie/exampleSite/archetypes/default.md create mode 100644 themes/archie/exampleSite/config.toml create mode 100644 themes/archie/exampleSite/content/_index.md create mode 100644 themes/archie/exampleSite/content/about.md create mode 100644 themes/archie/exampleSite/content/archives.md create mode 100644 themes/archie/exampleSite/content/homepage/about.md create mode 100644 themes/archie/exampleSite/content/homepage/index.md create mode 100644 themes/archie/exampleSite/content/homepage/work.md create mode 100644 themes/archie/exampleSite/content/posts/post-1.md create mode 100644 themes/archie/exampleSite/content/posts/post-2.md create mode 100644 themes/archie/exampleSite/content/posts/post-3.md create mode 100644 themes/archie/exampleSite/content/posts/post-4.md create mode 100644 themes/archie/exampleSite/content/posts/post-5.md create mode 100644 themes/archie/exampleSite/content/posts/post-6.md create mode 100644 themes/archie/exampleSite/content/posts/post-7.md create mode 100644 themes/archie/exampleSite/content/posts/tg-gh.md create mode 100644 themes/archie/images/archie-dark.png create mode 100644 themes/archie/images/screenshot.png create mode 100644 themes/archie/images/theme.png create mode 100644 themes/archie/images/tn.png create mode 100644 themes/archie/layouts/404.html create mode 100644 themes/archie/layouts/_default/baseof.html create mode 100644 themes/archie/layouts/_default/list.html create mode 100644 themes/archie/layouts/_default/single.html create mode 100644 themes/archie/layouts/_default/term.html create mode 100644 themes/archie/layouts/_default/terms.html create mode 100644 themes/archie/layouts/index.html create mode 100644 themes/archie/layouts/partials/footer.html create mode 100644 themes/archie/layouts/partials/head.html create mode 100644 themes/archie/layouts/partials/header.html create mode 100644 themes/archie/layouts/partials/paginator.html create mode 100644 themes/archie/layouts/shortcodes/callout.html create mode 100644 themes/archie/static/css/dark.css create mode 100644 themes/archie/static/css/fonts.css create mode 100644 themes/archie/static/css/main.css create mode 100644 themes/archie/static/fonts/fira-sans-v10-latin-regular.eot create mode 100644 themes/archie/static/fonts/fira-sans-v10-latin-regular.svg create mode 100644 themes/archie/static/fonts/fira-sans-v10-latin-regular.ttf create mode 100644 themes/archie/static/fonts/fira-sans-v10-latin-regular.woff create mode 100644 themes/archie/static/fonts/fira-sans-v10-latin-regular.woff2 create mode 100644 themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.eot create mode 100644 themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.svg create mode 100644 themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.ttf create mode 100644 themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff create mode 100644 themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff2 create mode 100644 themes/archie/static/fonts/roboto-mono-v12-latin-regular.eot create mode 100644 themes/archie/static/fonts/roboto-mono-v12-latin-regular.svg create mode 100644 themes/archie/static/fonts/roboto-mono-v12-latin-regular.ttf create mode 100644 themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff create mode 100644 themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff2 create mode 100644 themes/archie/static/js/feather.min.js create mode 100644 themes/archie/static/js/main.js create mode 100644 themes/archie/theme.toml diff --git a/config.toml b/config.toml index a67e06d..4947e7b 100644 --- a/config.toml +++ b/config.toml @@ -1,19 +1,21 @@ -baseURL = "https://blog.rogs.me" +baseURL = "https://rogs.me/" languageCode = "en-us" title = "rogs | Blog" -theme = "m10c" +theme = "archie" staticDir = ["static"] +paginate=3 # articles per page +copyright = "© Rogs" + [permalinks] posts = "/:year/:month/:title/" [params] author = "Roger Gonzalez" - description = "my blog, thoughts and other stuff" + subtitle = "my blog, thoughts and other stuff" avatar = "avatar.png" - [[params.social]] - name = "fas fa-globe" - url = "https://rogs.me" + mode = "dark" + [[params.social]] name = "fas fa-envelope" url = "mailto:roger@rogs.me" @@ -23,9 +25,6 @@ staticDir = ["static"] [[params.social]] name = "fab fa-linkedin-in" url = "https://linkedin.com/in/rogergonzalez21" - [[params.social]] - name = "fab fa-twitter" - url = "https://twitter.com/rogergonzalez21" [[params.social]] name = "fab fa-keybase" url = "https://keybase.io/rogs" @@ -42,7 +41,17 @@ staticDir = ["static"] name = "fab fa-paypal" url = "https://www.paypal.me/rogsme21" -[params.style] - darkestColor = "#38761d" - darkColor = "#212121" - lightColor = "#fafafa" +[[menu.main]] +name = "About" +url = "/" +weight = 1 + +[[menu.main]] +name = "Blog" +url = "/posts" +weight = 2 + +[[menu.main]] +name = "Tags" +url = "/tags" +weight = 3 diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..fdb9433 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,121 @@ +--- +title: "Home" +date: 2020-11-01T20:11:50-03:00 +lastmod: 2020-11-01T20:11:50-03:00 +tags : [ "dev", "hugo" ] +draft: false +--- +# Who am I? + +Hello world! I'm a Full-Stack web developer from Valencia, Venezuela, but now +living in [Montevideo, Uruguay](https://www.openstreetmap.org/relation/2929054). + +I have experience in front-end, back-end, and DevOps. New technologies fuel my +desire to learn more and more each day. I try to keep my code as clean as +possible, following established standards for the technology I'm using at the +moment. + +I love Open Source projects. Knowledge should be available to everyone who wants +it. + +You can check my resume in a more traditional format here: +[English](https://cloud.rogs.me/s/7Gyc9KmC7pxcmmG)| +[Spanish](https://cloud.rogs.me/s/4zHoy4Nd3SNgNKQ). + +# Experience + +## [Lazer Technologies](https://lazertechnologies.com/) +> September 2020 + +In Lazer Technologies we are working for [Certn](https://certn.co/). Certn is an +app that looks to ease the employers jobs of doing criminal background checks +for their employees. First, we built an app that acts as a bridge between our +main app and criminal background check providers (like the +[RCMP](https://www.rcmp-grc.gc.ca/)). Now we are working on a scraper for +multiple providers that don't have an API. In this project we are using Django, +Django REST Framework, Docker, PostgreSQL, Github Actions and Jenkins. + +## [Tarmac](https://tarmac.io) +> July 2020 + +I'm currently working on Tarmac on a project called "Volition". In Volition we +are developing a crawler that extracts information from different pages in order +to build a "super market place" for a specific product. In this project we are +using Docker, TypeScript, NodeJS, PostgreSQL, Google Cloud, and Kubernetes. + +## [Massive](https://massive.ag) +Senior Backend Developer + +> April 2019 - August 2020 + +I worked for Massive from April 2019 to August 2020. On my time in Massive, I +worked on one big project for Coca-Cola Mexico, called Tus Tapas Valen. "Tus +Tapas Valen" is an application that allowed clients to participate in promotions +and auctions, and win prizes. First I worked FrontEnd with ReactJS, Redux and +redux-observable, but now I'm working in the Backend. I had to plan a big +refactor while still working on new Backend functionalities. The Backend was +built using Python, Django, PostgreSQL, AWS, and AWS S3 + +## [Vascar Solutions](https://vascarsolutions.com/) +Backend Developer + +> December 2016 - June 2019 + +On my time in Vascar Solutions, I have been in many projects, most recently on +Knac and Axelerist. "Knac" is a job application startup, empathizing on +assessments to recommend candidates to a specific job. I worked on the backend +with NodeJS, Express, MongoDB, Mocha, CircleCI, Heroku and AWS. "Axelerist" is a +web app that connects to an external API and displays the client’s inventory in +a more friendly and ergonomic way. I worked on the backend, managing the API +connection, working on an API wrapper and user management. The app was made with +NodeJS, Express, MongoDB, Mocha, CircleCI, Heroku and AWS. + +# Education + +[**Univesidad Tecnológica del Centro (UNITEC)**](https://portal.unitec.edu.ve/) + +> September 2010 - December 2015 + +Engineering + +- Information Engineer + + Internship: Database system for Amcor Rigid Plastics de Venezuela + + Specializations: **1.** Web development, **2.** Automatization & **3.** Linux administration + + University groups: **1.** TecnoYucas, **2.** Centro de Investigación y + Tecnología (CIT), **3.** Centro de Tecnología y Robótica (CTR) + +# Skills +- **Programming Languages:** [Python](https://python.org/) | + [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) | + [Bash](https://www.gnu.org/software/bash/) +- **FrontEnd:** [HTML](https://html.spec.whatwg.org/multipage/) | + [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) | + [Bootstrap](https://getbootstrap.com/) | [ReactJS](https://reactjs.org/) +- **Backend:** [Django](https://www.djangoproject.com/) | [Django REST + Framework](https://www.django-rest-framework.org/) | + [NodeJS](https://nodejs.org/en/) | [Express](https://expressjs.com/) | + [Flask](https://flask.palletsprojects.com/en/1.1.x/) | + [MySQL](https://www.mysql.com/) | [PostgreSQL](https://www.postgresql.org/) | + [MongoDB](https://www.mongodb.com/) +- **Servers and Infrastructure:** [Amazon Web Services](https://aws.amazon.com/) + | [DigitalOcean](https://www.digitalocean.com/) | [Linode](https://linode.com) + | [Docker](https://www.docker.com/) | [Heroku](https://www.heroku.com/) | + [NGINX](https://nginx.org/) | [Apache](https://www.apache.org/) +- **Others:** [Linux](https://linux.org/) | + [Emacs](https://www.gnu.org/software/emacs/) | [Git](https://git-scm.com/) | + [Scrum](https://www.scrum.org/) | [CircleCI](https://circleci.com/) | + [Mocha](https://mochajs.org/) | [EsLint](https://eslint.org/) + +## Workflow +- REST API design +- Follow the ["Twelve factor app"](https://12factor.net/) +- Cross Functional Teams +- Agile Development & Scrum + +# Certifications +- English Course with practice & lesson sections, full English environment - +Berlitz English +- [Build a Backend REST API with Python & Django - Advanced - + Udemy](https://www.udemy.com/certificate/UC-A1CXJVDP/) +- [Build a Backend REST API with Python & Django - Beginner - + Udemy](https://www.udemy.com/certificate/UC-SNTLVIV0/) diff --git a/content/posts.org b/content/posts.org deleted file mode 100644 index 12b6eb8..0000000 --- a/content/posts.org +++ /dev/null @@ -1,208 +0,0 @@ -#+hugo_base_dir: ../ -#+hugo_section: ./posts - -#+hugo_weight: auto -#+hugo_auto_set_lastmod: t - -#+author: Roger Gonzalez - -* Programming :@programming: -All posts in here will have the category set to /programming/. -** How I got a residency appointment thanks to Python, Selenium and Telegram :python::selenium:telegram: -:PROPERTIES: -:EXPORT_FILE_NAME: how-i-got-a-residency-appointment-thanks-to-python-and-selenium -:EXPORT_DATE: 2020-08-02 -:END: -Hello everyone! - -As some of you might know, I'm a Venezuelan 🇻🇪 living in Montevideo, Uruguay 🇺🇾. -I've been living here for almost a year, but because of the pandemic my -residency appointments have slowed down to a crawl, and in the middle of the -quarantine they added a new appointment system. Before, there were no -appointments, you just had to get there early and wait for the secretary to -review your files and assign someone to attend you. But now, they had -implemented an appointment system that you could do from the comfort of your own -home/office. There was just one issue: *there were never appointments available*. - -That was a little stressful. I was developing a small /tick/ by checking the -site multiple times a day, with no luck. But then, I decided I wanted to do a -bot that checks the site for me, that way I could just forget about it and let -the computers do it for me. - -*** Tech -**** Selenium -I had some experience with Selenium in the past because I had to run automated -tests on an Android application, but I had never used it for the web. I knew it -supported Firefox and had an extensive API to interact with websites. In the -end, I just had to inspect the HTML and search for the "No appointments -available" error message. If the message wasn't there, I needed a way to be -notified so I can set my appointment as fast as possible. -**** Telegram Bot API -Telegram was my goto because I have a lot of experience with it. It has a -stupidly easy API that allows for superb bot management. I just needed the bot -to send me a message whenever the "No appointments available" message wasn't -found on the site. - -*** The plan -Here comes the juicy part: How is everything going to work together? - -I divided the work into four parts: -1) Inspecting the site -2) Finding the error message on the site -3) Sending the message if nothing was found -4) Deploy the job with a cronjob on my VPS - -*** Inspecting the site -Here is the site I needed to inspect: -- On the first site, I need to click the bottom button. By inspecting the HTML, - I found out that its name is ~form:botonElegirHora~ - [[/2020-08-02-171251.png]] -- When the button is clicked, it loads a second page that has an error message - if no appointments are found. The ID of that message is ~form:warnSinCupos~. - [[/2020-08-02-162205.png]] - -*** Using Selenium to find the error message -First, I needed to define the browser session and its settings. I wanted to run -it in headless mode so no X session is needed: -#+BEGIN_SRC python -from selenium import webdriver -from selenium.webdriver.firefox.options import Options - -options = Options() -options.headless = True -d = webdriver.Firefox(options=options) -#+END_SRC - -Then, I opened the site, looked for the button (~form:botonElegirHora~) and -clicked it -#+BEGIN_SRC python -# This is the website I wanted to scrape -d.get('https://sae.mec.gub.uy/sae/agendarReserva/Paso1.xhtml?e=9&a=7&r=13') -elem = d.find_element_by_name('form:botonElegirHora') -elem.click() -#+END_SRC - -And on the new page, I looked for the error message (~form:warnSinCupos~) -#+BEGIN_SRC python -try: - warning_message = d.find_element_by_id('form:warnSinCupos') -except Exception: - pass -#+END_SRC - -This was working exactly how I wanted: It opened a new browser session, opened -the site, clicked the button, and then looked for the message. For now, if the -message wasn't found, it does nothing. Now, the script needs to send me a -message if the warning message wasn't found on the page. - -*** Using Telegram to send a message if the warning message wasn't found -The Telegram bot API has a very simple way to send messages. If you want to read -more about their API, you can check it [[https://core.telegram.org/][here]]. - -There are a few steps you need to follow to get a Telegram bot: -1) First, you need to "talk" to the [[https://core.telegram.org/bots#6-botfather][Botfather]] to create the bot. -2) Then, you need to find your Telegram Chat ID. There are a few bots that can help - you with that, I personally use ~@get_id_bot~. -3) Once you have the ID, you should read the ~sendMessage~ API, since that's the - only one we need now. You can check it [[https://core.telegram.org/bots/api#sendmessage][here]]. - -So, by using the Telegram documentation, I came up with the following code: -#+BEGIN_SRC python -import requests - -chat_id = # Insert your chat ID here -telegram_bot_id = # Insert your Telegram bot ID here -telegram_data = { - "chat_id": chat_id - "parse_mode": "HTML", - "text": ("Hay citas!\nHay citas en el registro civil, para " - f"entrar ve a {SAE_URL}") -} -requests.post('https://api.telegram.org/bot{telegram_bot_id}/sendmessage', data=telegram_data) -#+END_SRC - -*** The complete script -I added a few loggers and environment variables and voilá! Here is the complete code: -#+BEGIN_SRC python -#!/usr/bin/env python3 - -import os -import requests -from datetime import datetime - -from selenium import webdriver -from selenium.webdriver.firefox.options import Options - -from dotenv import load_dotenv - -load_dotenv() # This loads the environmental variables from the .env file in the root folder - -TELEGRAM_BOT_ID = os.environ.get('TELEGRAM_BOT_ID') -TELEGRAM_CHAT_ID = os.environ.get('TELEGRAM_CHAT_ID') -SAE_URL = 'https://sae.mec.gub.uy/sae/agendarReserva/Paso1.xhtml?e=9&a=7&r=13' - -options = Options() -options.headless = True -d = webdriver.Firefox(options=options) -d.get(SAE_URL) -print(f'Headless Firefox Initialized {datetime.now()}') -elem = d.find_element_by_name('form:botonElegirHora') -elem.click() -try: - warning_message = d.find_element_by_id('form:warnSinCupos') - print('No dates yet') - print('------------------------------') -except Exception: - telegram_data = { - "chat_id": TELEGRAM_CHAT_ID, - "parse_mode": "HTML", - "text": ("Hay citas!\nHay citas en el registro civil, para " - f"entrar ve a {SAE_URL}") - } - requests.post('https://api.telegram.org/bot' - f'{TELEGRAM_BOT_ID}/sendmessage', data=telegram_data) - print('Dates found!') -d.close() # To close the browser connection -#+END_SRC - -Only one more thing to do, to deploy everything to my VPS - -*** Deploy and testing on the VPS -This was very easy. I just needed to pull my git repo, install the -~requirements.txt~ and set a new cron to run every 10 minutes and check the -site. The cron settings I used where: -#+BEGIN_SRC bash -*/10 * * * * /usr/bin/python3 /my/script/location/registro-civil-scraper/app.py >> /my/script/location/registro-civil-scraper/log.txt -#+END_SRC -The ~>> /my/script/location/registro-civil-scraper/log.txt~ part is to keep the logs on a new file. - -*** Did it work? -Yes! And it worked perfectly. I got a message the following day at 21:00 -(weirdly enough, that's 0:00GMT, so maybe they have their servers at GMT time -and it opens new appointments at 0:00). -[[/2020-08-02-170458.png]] - -*** Conclusion -I always loved to use programming to solve simple problems. With this script, I -didn't need to check the site every couple of hours to get an appointment, and -sincerely, I wasn't going to check past 19:00, so I would've never found it by -my own. - -My brother is having similar issues in Argentina, and when I showed him this, he -said one of the funniest phrases I've heard about my profession: - -> /"Programmers could take over the world, but they are too lazy"/ - -I lol'd way too hard at that. - -I loved Selenium and how it worked. Recently I created a crawler using Selenium, -Redis, peewee, and Postgres, so stay tuned if you want to know more about that. - -In the meantime, if you want to check the complete script, you can see it on my -Git instance: https://git.rogs.me/me/registro-civil-scraper or Gitlab, if you -prefer: https://gitlab.com/rogs/registro-civil-scraper - -* COMMENT Local Variables -# Local Variables: -# eval: (org-hugo-auto-export-mode) -# End: diff --git a/content/posts/how-i-got-a-residency-appointment-thanks-to-python-and-selenium.md b/content/posts/how-i-got-a-residency-appointment-thanks-to-python-and-selenium.md index fe7d46a..a080a6b 100644 --- a/content/posts/how-i-got-a-residency-appointment-thanks-to-python-and-selenium.md +++ b/content/posts/how-i-got-a-residency-appointment-thanks-to-python-and-selenium.md @@ -2,7 +2,7 @@ title = "How I got a residency appointment thanks to Python, Selenium and Telegram" author = ["Roger Gonzalez"] date = 2020-08-02 -lastmod = 2020-08-03T11:44:38-03:00 +lastmod = 2020-11-02T17:34:24-03:00 tags = ["python", "selenium", "telegram"] categories = ["programming"] draft = false diff --git a/content/posts/how-to-scrape-your-auth0-database-with-django.md b/content/posts/how-to-scrape-your-auth0-database-with-django.md new file mode 100644 index 0000000..885766f --- /dev/null +++ b/content/posts/how-to-scrape-your-auth0-database-with-django.md @@ -0,0 +1,270 @@ +--- +title: "How to create a management command and scrape your Auth0 database with Django" +date: 2020-06-30T09:40:48-03:00 +lastmod: 2020-06-30T09:40:48-03:00 +tags : [ "python", "django", "programming" ] +draft: true +--- + +Hello everyone! + +Some months ago, our data analyst needed to extract some data from Auth0 and match it with our profiles +database, so I decided we needed a new table to relate the Auth0 information with the profiles +information. + +# The solution + +This was a really easy but interesting task. The steps I came up with were: + +- Create a new model to save the data from Auth0 +- Create a new management command +- Create a cron to run the management command every night + +# Creating the model + +The model was really easy, I just created a field for each of the fields I want: + +```python +class Auth0Data(models.Model): + """Auth0 data straight from auth0""" + profile = models.ForeignKey(Profile, on_delete=models.CASCADE) + name = models.CharField(max_length=255, blank=True, null=True) + last_name = models.CharField(max_length=255, blank=True, null=True) + email = models.CharField(max_length=255, blank=True, null=True) + last_ip = models.CharField(max_length=255, blank=True, null=True) + login_count = models.CharField(max_length=255, blank=True, null=True) + last_login = models.DateTimeField(null=True, blank=True) + email_verified = models.BooleanField(default=False) + created_at = models.DateTimeField() + updated_at = models.DateTimeField() + + def __str__(self): + return str(self.profile) +``` + +# Creating the management command + +I want to run the command with a cron, so I need a way to run it outside of Django's runtime. I want the +command to run as `python manage.py scrape_auth0`. In order to do this, I have to create a specific +folder structure inside my application. + +Let's asume my Project is called `library` and my Django app is called `book`. I have to create the +following folder structure: +``` +├── library # my project root +│   ├── book # my app name +│   │   ├── management +│   │   │   ├── commands +│   │   │   │   ├── scrape_auth0.py +│   │   │   ├── __init__.py +``` + +First, let's create the folders we need. On the root of our application we can run: + +```sh +mkdir -p book/management/commands +touch book/management/commands/__init__.py +touch book/management/commands/scrape_auth0.py +``` + +In case you don't know, the `__init__.py` file is used to indentify Pyton packages. + +Now, you can open `scrape_auth0.py` on your text editor and start creating your command! + +The basic structure to create a command is: + +```python +from django.core.management.base import BaseCommand + +class Command(BaseCommand): + + def handle(self, *args, **options): + # my command here +``` + +What's going on here? +- First we create the class "Command", and inherit from `BaseCommand`. Every command has to inherit from it +- Inside the class, we need to override the `handle` function. That's where we are going to write our command. + +## The complete Auth0 command + +Here is the entire command: + +```python +import time +import csv +import requests +import gzip +import json +import datetime +import os + +from django.core.management.base import BaseCommand +from core.models import Profile, Auth0Data + +token = os.environ.get('AUTH0_MANAGEMENT_TOKEN') +headers = {'Authorization': f'Bearer {token}', + 'Content-Type': 'application/json'} + + +class Command(BaseCommand): + """Django command to load all the pincodes in the db""" + + def handle(self, *args, **options): + self.stdout.write('Scraping...') + self.stdout.write('Getting the connections...') + + connections = requests.get( + 'https://destapp.auth0.com/api/v2/connections', + headers=headers + ).json() + + self.stdout.write('Connections found!') + + for connection in connections: + connection_id = connection['id'] + connection_name = connection['name'] + self.stdout.write( + f'Working with connection {connection_name}, ' + f'{connection_id}') + + data = json.dumps({ + 'connection_id': connection_id, + 'format': 'csv', + 'limit': 99999999, + 'fields': [ + { + 'name': 'user_id' + }, + { + 'name': 'family_name' + }, + { + 'name': 'given_name' + }, + { + 'name': 'email' + }, + { + 'name': 'last_ip' + }, + { + 'name': 'logins_count' + }, + { + 'name': 'created_at' + }, + { + 'name': 'updated_at' + }, + { + 'name': 'last_login' + }, + { + 'name': 'email_verified' + } + ] + }) + + self.stdout.write('Generating job...') + job = requests.post( + 'https://destapp.auth0.com/api/v2/jobs/users-exports', + data=data, + headers=headers + ) + job_id = job.json()['id'] + self.stdout.write(f'The job ID is {job_id}') + time.sleep(5) + + job_is_running = True + + while job_is_running: + check_job = requests.get( + f'https://destapp.auth0.com/api/v2/jobs/{job_id}', + headers=headers + ).json() + + status = check_job['status'] + + if status == 'pending': + self.stdout.write('Job has not started, waiting') + time.sleep(30) + elif status == 'processing': + percentage_done = check_job['percentage_done'] + seconds_left = datetime.timedelta( + seconds=check_job['time_left_seconds']) + + self.stdout.write(f'Procesed: {percentage_done}%') + self.stdout.write(f'Time left: {seconds_left}') + time.sleep(10) + elif status == 'completed': + job_is_running = False + self.stdout.write('100%') + self.stdout.write('Data is ready!') + export_url = check_job['location'] + + export_data = requests.get(export_url, stream=True) + + file_location = 'core/management/commands/auth0_file.csv.gz' + + with open(file_location, 'wb') as f: + self.stdout.write('Downloading the file') + for chunk in export_data.iter_content(chunk_size=1024): + if chunk: + f.write(chunk) + f.flush() + self.stdout.write('File ready!') + f.close() + + with gzip.open(file_location, 'rt') as f: + reader = csv.reader(f, delimiter=',', quotechar='"') + for row in reader: + auth0_id = row[0].replace('|', '.') + last_name = row[1] + name = row[2] + email = row[3] + last_ip = row[4] + login_count = row[5] + created_at = row[6] + updated_at = row[7] + last_login = None + if row[8] != '': + last_login = row[8] + email_verified = False + if row[9] == 'true': + email_verified = True + + try: + profile = Profile.objects.get(auth0_id=auth0_id) + auth0_data = Auth0Data.objects.get(profile=profile) + + auth0_data.name = name + auth0_data.last_name = last_name + auth0_data.email = email + auth0_data.last_ip = last_ip + auth0_data.login_count = login_count + auth0_data.created_at = created_at + auth0_data.updated_at = updated_at + auth0_data.last_login = last_login + auth0_data.email_verified = email_verified + + auth0_data.save() + self.stdout.write(f'Updated Auth0Data for {profile}') + + except Auth0Data.DoesNotExist: + Auth0Data.objects.create( + profile=profile, + name=name, + last_name=last_name, + email=email, + last_ip=last_ip, + login_count=login_count, + created_at=created_at, + updated_at=updated_at, + last_login=last_login, + email_verified=email_verified + ) + self.stdout.write(f'Created Auth0Data for {profile}') + except Profile.DoesNotExist: + pass +``` diff --git a/posts.org b/posts.org new file mode 100644 index 0000000..28a0ff6 --- /dev/null +++ b/posts.org @@ -0,0 +1,209 @@ +#+hugo_base_dir: ./ +#+hugo_section: ./posts + +#+hugo_weight: auto +#+hugo_auto_set_lastmod: t + +#+author: Roger Gonzalez + +* Programming :@programming: +All posts in here will have the category set to /programming/. +** How I got a residency appointment thanks to Python, Selenium and Telegram :python::selenium:telegram: +:PROPERTIES: +:EXPORT_FILE_NAME: how-i-got-a-residency-appointment-thanks-to-python-and-selenium +:EXPORT_DATE: 2020-08-02 +:TLDR: keklol +:END: +Hello everyone! + +As some of you might know, I'm a Venezuelan 🇻🇪 living in Montevideo, Uruguay 🇺🇾. +I've been living here for almost a year, but because of the pandemic my +residency appointments have slowed down to a crawl, and in the middle of the +quarantine they added a new appointment system. Before, there were no +appointments, you just had to get there early and wait for the secretary to +review your files and assign someone to attend you. But now, they had +implemented an appointment system that you could do from the comfort of your own +home/office. There was just one issue: *there were never appointments available*. + +That was a little stressful. I was developing a small /tick/ by checking the +site multiple times a day, with no luck. But then, I decided I wanted to do a +bot that checks the site for me, that way I could just forget about it and let +the computers do it for me. + +*** Tech +**** Selenium +I had some experience with Selenium in the past because I had to run automated +tests on an Android application, but I had never used it for the web. I knew it +supported Firefox and had an extensive API to interact with websites. In the +end, I just had to inspect the HTML and search for the "No appointments +available" error message. If the message wasn't there, I needed a way to be +notified so I can set my appointment as fast as possible. +**** Telegram Bot API +Telegram was my goto because I have a lot of experience with it. It has a +stupidly easy API that allows for superb bot management. I just needed the bot +to send me a message whenever the "No appointments available" message wasn't +found on the site. + +*** The plan +Here comes the juicy part: How is everything going to work together? + +I divided the work into four parts: +1) Inspecting the site +2) Finding the error message on the site +3) Sending the message if nothing was found +4) Deploy the job with a cronjob on my VPS + +*** Inspecting the site +Here is the site I needed to inspect: +- On the first site, I need to click the bottom button. By inspecting the HTML, + I found out that its name is ~form:botonElegirHora~ + [[/2020-08-02-171251.png]] +- When the button is clicked, it loads a second page that has an error message + if no appointments are found. The ID of that message is ~form:warnSinCupos~. + [[/2020-08-02-162205.png]] + +*** Using Selenium to find the error message +First, I needed to define the browser session and its settings. I wanted to run +it in headless mode so no X session is needed: +#+BEGIN_SRC python +from selenium import webdriver +from selenium.webdriver.firefox.options import Options + +options = Options() +options.headless = True +d = webdriver.Firefox(options=options) +#+END_SRC + +Then, I opened the site, looked for the button (~form:botonElegirHora~) and +clicked it +#+BEGIN_SRC python +# This is the website I wanted to scrape +d.get('https://sae.mec.gub.uy/sae/agendarReserva/Paso1.xhtml?e=9&a=7&r=13') +elem = d.find_element_by_name('form:botonElegirHora') +elem.click() +#+END_SRC + +And on the new page, I looked for the error message (~form:warnSinCupos~) +#+BEGIN_SRC python +try: + warning_message = d.find_element_by_id('form:warnSinCupos') +except Exception: + pass +#+END_SRC + +This was working exactly how I wanted: It opened a new browser session, opened +the site, clicked the button, and then looked for the message. For now, if the +message wasn't found, it does nothing. Now, the script needs to send me a +message if the warning message wasn't found on the page. + +*** Using Telegram to send a message if the warning message wasn't found +The Telegram bot API has a very simple way to send messages. If you want to read +more about their API, you can check it [[https://core.telegram.org/][here]]. + +There are a few steps you need to follow to get a Telegram bot: +1) First, you need to "talk" to the [[https://core.telegram.org/bots#6-botfather][Botfather]] to create the bot. +2) Then, you need to find your Telegram Chat ID. There are a few bots that can help + you with that, I personally use ~@get_id_bot~. +3) Once you have the ID, you should read the ~sendMessage~ API, since that's the + only one we need now. You can check it [[https://core.telegram.org/bots/api#sendmessage][here]]. + +So, by using the Telegram documentation, I came up with the following code: +#+BEGIN_SRC python +import requests + +chat_id = # Insert your chat ID here +telegram_bot_id = # Insert your Telegram bot ID here +telegram_data = { + "chat_id": chat_id + "parse_mode": "HTML", + "text": ("Hay citas!\nHay citas en el registro civil, para " + f"entrar ve a {SAE_URL}") +} +requests.post('https://api.telegram.org/bot{telegram_bot_id}/sendmessage', data=telegram_data) +#+END_SRC + +*** The complete script +I added a few loggers and environment variables and voilá! Here is the complete code: +#+BEGIN_SRC python +#!/usr/bin/env python3 + +import os +import requests +from datetime import datetime + +from selenium import webdriver +from selenium.webdriver.firefox.options import Options + +from dotenv import load_dotenv + +load_dotenv() # This loads the environmental variables from the .env file in the root folder + +TELEGRAM_BOT_ID = os.environ.get('TELEGRAM_BOT_ID') +TELEGRAM_CHAT_ID = os.environ.get('TELEGRAM_CHAT_ID') +SAE_URL = 'https://sae.mec.gub.uy/sae/agendarReserva/Paso1.xhtml?e=9&a=7&r=13' + +options = Options() +options.headless = True +d = webdriver.Firefox(options=options) +d.get(SAE_URL) +print(f'Headless Firefox Initialized {datetime.now()}') +elem = d.find_element_by_name('form:botonElegirHora') +elem.click() +try: + warning_message = d.find_element_by_id('form:warnSinCupos') + print('No dates yet') + print('------------------------------') +except Exception: + telegram_data = { + "chat_id": TELEGRAM_CHAT_ID, + "parse_mode": "HTML", + "text": ("Hay citas!\nHay citas en el registro civil, para " + f"entrar ve a {SAE_URL}") + } + requests.post('https://api.telegram.org/bot' + f'{TELEGRAM_BOT_ID}/sendmessage', data=telegram_data) + print('Dates found!') +d.close() # To close the browser connection +#+END_SRC + +Only one more thing to do, to deploy everything to my VPS + +*** Deploy and testing on the VPS +This was very easy. I just needed to pull my git repo, install the +~requirements.txt~ and set a new cron to run every 10 minutes and check the +site. The cron settings I used where: +#+BEGIN_SRC bash +*/10 * * * * /usr/bin/python3 /my/script/location/registro-civil-scraper/app.py >> /my/script/location/registro-civil-scraper/log.txt +#+END_SRC +The ~>> /my/script/location/registro-civil-scraper/log.txt~ part is to keep the logs on a new file. + +*** Did it work? +Yes! And it worked perfectly. I got a message the following day at 21:00 +(weirdly enough, that's 0:00GMT, so maybe they have their servers at GMT time +and it opens new appointments at 0:00). +[[/2020-08-02-170458.png]] + +*** Conclusion +I always loved to use programming to solve simple problems. With this script, I +didn't need to check the site every couple of hours to get an appointment, and +sincerely, I wasn't going to check past 19:00, so I would've never found it by +my own. + +My brother is having similar issues in Argentina, and when I showed him this, he +said one of the funniest phrases I've heard about my profession: + +> /"Programmers could take over the world, but they are too lazy"/ + +I lol'd way too hard at that. + +I loved Selenium and how it worked. Recently I created a crawler using Selenium, +Redis, peewee, and Postgres, so stay tuned if you want to know more about that. + +In the meantime, if you want to check the complete script, you can see it on my +Git instance: https://git.rogs.me/me/registro-civil-scraper or Gitlab, if you +prefer: https://gitlab.com/rogs/registro-civil-scraper + +* COMMENT Local Variables +# Local Variables: +# eval: (org-hugo-auto-export-mode) +# End: diff --git a/static/avatar.png b/static/avatar.png index cd42d3e..aeb8449 100644 Binary files a/static/avatar.png and b/static/avatar.png differ diff --git a/themes/archie/.github/FUNDING.yml b/themes/archie/.github/FUNDING.yml new file mode 100644 index 0000000..8cb3ec3 --- /dev/null +++ b/themes/archie/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +ko_fi: athulcyriac +custom: read.gift/u/athulcajay diff --git a/themes/archie/LICENSE b/themes/archie/LICENSE new file mode 100644 index 0000000..646ad35 --- /dev/null +++ b/themes/archie/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2020 ATHUL CYRIAC AJAY + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/archie/README.md b/themes/archie/README.md new file mode 100644 index 0000000..ebaaadc --- /dev/null +++ b/themes/archie/README.md @@ -0,0 +1,106 @@ +# Archie - Hugo theme +Archie is a minimal and clean theme for hugo with a markdown-ish UI. + +Forked from [Ezhil Theme](https://github.com/vividvilla/ezhil) + +## Demo + +[Check the Demo](https://athul.github.io/archie/) hosted on GitHub Pages :smile: . You can find the source code to that in the `site` branch of this repository + +![](/images/theme.png) +![](/images/archie-dark.png) +## Feature +- Google Analytics Script +- Callouts +- Tags +- Auto Dark Mode(based on system theme) +- tl:dr; frontamatter + +## Installation +In your Hugo website directory, create a new folder named theme and clone the repo +```bash +$ mkdir themes +$ cd themes +$ git clone https://github.com/athul/archie.git +``` +Edit the `config.toml` file with `theme="archie"` +For more information read the official [setup guide](https://gohugo.io/overview/installing/) of Hugo. + +## Writing Posts +Create a new `.md` file in the *content/posts* folder +```yml +--- +title: Title of the post +description: +date: +tldr: (optional) +draft: true/false (optional) +tags: [tag names] (optional) +--- +``` + +## Credits +Forked from [Ezhil Theme](https://github.com/vividvilla/ezhil) and Licensed under MIT License +Inspired by design of blog.jse.li + +---- + +## Config of the Demo Site + +```toml +baseURL = "https://athul.github.io/archie/" +languageCode = "en-us" +title = "Archie" +theme="archie" +copyright = "© Athul" +# Code Highlight +pygmentsstyle = "monokai" +pygmentscodefences = true +pygmentscodefencesguesssyntax = true + +paginate=3 # articles per page + +[params] + mode="auto" # color-mode → light,dark or auto + useCDN=false # don't use CDNs for fonts and icons, instead serve them locally. + subtitle = "Minimal and Clean [blog theme for Hugo](https://github.com/athul/archie)" + +# Social Tags + +[[params.social]] +name = "GitHub" +icon = "github" +url = "https://github.com/athul/archie" + +[[params.social]] +name = "Twitter" +icon = "twitter" +url = "https://twitter.com/athulcajay/" + +[[params.social]] +name = "GitLab" +icon = "gitlab" +url = "https://gitlab.com/athul/" + +# Main menu Items + +[[menu.main]] +name = "Home" +url = "/" +weight = 1 + +[[menu.main]] +name = "All posts" +url = "/posts" +weight = 2 + +[[menu.main]] +name = "About" +url = "/about" +weight = 3 + +[[menu.main]] +name = "Tags" +url = "/tags" +weight = 4 +``` diff --git a/themes/archie/archetypes/default.md b/themes/archie/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/themes/archie/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/themes/archie/exampleSite/archetypes/default.md b/themes/archie/exampleSite/archetypes/default.md new file mode 100644 index 0000000..26f317f --- /dev/null +++ b/themes/archie/exampleSite/archetypes/default.md @@ -0,0 +1,5 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- diff --git a/themes/archie/exampleSite/config.toml b/themes/archie/exampleSite/config.toml new file mode 100644 index 0000000..d7c4fb2 --- /dev/null +++ b/themes/archie/exampleSite/config.toml @@ -0,0 +1,48 @@ +baseURL = "https://example.com" +languageCode = "en-us" +title = "Archie" +theme="archie" +copyright = "© Athul" +pygmentsstyle = "monokai" +pygmentscodefences = true +pygmentscodefencesguesssyntax = true +[params] + mode="auto" + useCDN=false + subtitle = "Minimal and Clean [blog theme for Hugo](https://github.com/athul/archie)" + +[[params.social]] +name = "GitHub" +icon = "github" +url = "https://github.com/athul/archie" + +[[params.social]] +name = "Twitter" +icon = "twitter" +url = "https://github.com/athulcajay/" + +[[params.social]] +name = "GitLab" +icon = "gitlab" +url = "https://gitlab.com/athul/" + +[[menu.main]] +name = "Home" +url = "/" +weight = 1 + +[[menu.main]] +name = "Blog" +url = "/blog" +weight = 2 + +[[menu.main]] +name = "All posts" +url = "/posts" +weight = 3 + + +[[menu.main]] +name = "Tags" +url = "/tags" +weight = 4 diff --git a/themes/archie/exampleSite/content/_index.md b/themes/archie/exampleSite/content/_index.md new file mode 100644 index 0000000..6abc75e --- /dev/null +++ b/themes/archie/exampleSite/content/_index.md @@ -0,0 +1,4 @@ ++++ +author = "Hugo Authors" ++++ + diff --git a/themes/archie/exampleSite/content/about.md b/themes/archie/exampleSite/content/about.md new file mode 100644 index 0000000..a412806 --- /dev/null +++ b/themes/archie/exampleSite/content/about.md @@ -0,0 +1,28 @@ ++++ +title = "About" +description = "Hugo, the world’s fastest framework for building websites" +date = "2019-02-28" +aliases = ["about-us","about-hugo","contact"] +author = "Hugo Authors" ++++ + +Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. + +Hugo makes use of a variety of open source projects including: + +* https://github.com/yuin/goldmark +* https://github.com/alecthomas/chroma +* https://github.com/muesli/smartcrop +* https://github.com/spf13/cobra +* https://github.com/spf13/viper + +Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. + +Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. + +Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. + +Learn more and contribute on [GitHub](https://github.com/gohugoio). + + + diff --git a/themes/archie/exampleSite/content/archives.md b/themes/archie/exampleSite/content/archives.md new file mode 100644 index 0000000..98a1ee9 --- /dev/null +++ b/themes/archie/exampleSite/content/archives.md @@ -0,0 +1,5 @@ +--- +date: 2019-05-28 +type: section +layout: "archives" +--- \ No newline at end of file diff --git a/themes/archie/exampleSite/content/homepage/about.md b/themes/archie/exampleSite/content/homepage/about.md new file mode 100644 index 0000000..c2ba680 --- /dev/null +++ b/themes/archie/exampleSite/content/homepage/about.md @@ -0,0 +1,7 @@ +--- +title: 'Our Difference' +button: 'About us' +weight: 2 +--- + +Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. ipsum dolor sit amet, et essent mediocritatem quo, \ No newline at end of file diff --git a/themes/archie/exampleSite/content/homepage/index.md b/themes/archie/exampleSite/content/homepage/index.md new file mode 100644 index 0000000..01ffa31 --- /dev/null +++ b/themes/archie/exampleSite/content/homepage/index.md @@ -0,0 +1,3 @@ +--- +headless : true +--- diff --git a/themes/archie/exampleSite/content/homepage/work.md b/themes/archie/exampleSite/content/homepage/work.md new file mode 100644 index 0000000..f2fee73 --- /dev/null +++ b/themes/archie/exampleSite/content/homepage/work.md @@ -0,0 +1,7 @@ +--- +title: 'We Help Business Grow' +button: 'Our Work' +weight: 1 +--- + +Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Numquam dolores mel eu, mea docendi omittantur et, mea ea duis erat. Elit melius cu ius. Per ex novum tantas putant, ei his nullam aliquam apeirian. Aeterno quaestio constituto sea an, no eum intellegat assueverit. \ No newline at end of file diff --git a/themes/archie/exampleSite/content/posts/post-1.md b/themes/archie/exampleSite/content/posts/post-1.md new file mode 100644 index 0000000..293bdc3 --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-1.md @@ -0,0 +1,62 @@ +--- +title: "Primer: When You Have Too Much to Do" +date: 2020-04-01T02:01:58+05:30 +description: "You have a to-do list that scrolls on for days. You are managing multiple projects, getting lots of email and messages on different messaging systems, managing finances and personal health habits and so much more." +tags: [Primer, todo] +--- + +You have a to-do list that scrolls on for days. You are managing multiple projects, getting lots of email and messages on different messaging systems, managing finances and personal health habits and so much more. + +It all keeps piling up, and it can feel overwhelming. + +How do you keep up with it all? How do you find focus and peace and get stuff accomplished when you have too much on your plate? + +In this primer, I’ll look at some key strategies and tactics for taking on an overloaded life with an open heart, lots of energy, and a smile on your face. + +## The First Step: Triage + +Whether you’re just starting your day, or you’re in the middle of the chaos and just need to find some sanity … the first step is to get into triage mode. + +Triage, as you probably know, is sorting through the chaos to prioritize: what needs to be done now, what needs to be done today, what needs to be done this week, and what can wait? You’re looking at urgency, but also what’s meaningful and important. + +Here’s what you might do: + +* Pick out the things that need to be done today. Start a Short List for things you’re going to do today. That might be important tasks for big projects, urgent tasks that could result in damage if you don’t act, smaller admin tasks that you really should take care of today, and responding to important messages. I would recommend being ruthless and cutting out as much as you can, having just 5 things on your plate if that’s at all possible. Not everything needs to be done today, and not every email needs to be responded to. +* Push some things to tomorrow and the rest of the week. If you have deadlines that can be pushed back (or renegotiated), do that. Spread the work out over the week, even into next week. What needs to be done tomorrow? What can wait a day or two longer? +* Eliminate what you can. That might mean just not replying to some messages that aren’t that important and don’t really require a reply. It might mean telling some people that you can’t take on this project after all, or that you need to get out of the commitment that you said you’d do. Yes, this is uncomfortable. For now, just put them on a list called, “To Not Do,” and plan to figure out how to get out of them later. + +OK, you have some breathing room and a manageable list now! Let’s shrink that down even further and just pick one thing. + +## Next: Focus on One Thing + +With a lot on your plate, it’s hard to pick one thing to focus on. But that’s exactly what I’m going to ask you to do. + +Pick one thing, and give it your focus. Yes, there are a lot of other things you can focus on. Yes, they’re stressing you out and making it hard to focus. But think about it this way: if you allow it all to be in your head all the time, that will always be your mode of being. You’ll always be thinking about everything, stressing out about it all, with a frazzled mind … unless you start shifting. + +The shift: + +* Pick something to focus on. Look at the triaged list from the first section … if you have 5-6 things on this Short List, you can assess whether there’s any super urgent, time-sensitive things you need to take care of. If there are, pick one of them. If not, pick the most important one — probably the one you have been putting off doing. +* Clear everything else away. Just for a little bit. Close all browser tabs, turn off notifications, close open applications, put your phone away. +* Put that one task before you, and allow yourself to be with it completely. Pour yourself into it. Think of it as a practice, of letting go (of everything else), of focus, of radical simplicity. + +When you’re done (or after 15-20 minutes have gone by at least), you can switch to something else. But don’t allow yourself to switch until then. + +By closing off all exits, by choosing one thing, by giving yourself completely to that thing … you’re now in a different mode that isn’t so stressful or spread thin. You’ve started a shift that will lead to focus and sanity. + +## Third: Schedule Time to Simplify + +Remember the To Not Do list above? Schedule some time this week to start reducing your projects, saying no to people, getting out of commitments, crossing stuff off your task list … so that you can have some sanity back. + +There are lots of little things that you’ve said “yes” to that you probably shouldn’t have. That’s why you’re overloaded. Protect your more important work, and your time off, and your peace of mind, by saying “no” to things that aren’t as important. + +Schedule the time to simplify — you don’t have to do it today, but sometime soon — and you can then not have to worry about the things on your To Not Do list until then. + +## Fourth: Practice Mindful Focus + +Go through the rest of the day with an attitude of “mindful focus.” That means that you are doing one thing at a time, being as present as you can, switching as little as you can. + +Think of it as a settling of the mind. A new mode of being. A mindfulness practice (which means you won’t be perfect at it). + +As you practice mindful focus, you’ll learn to practice doing things with an open heart, with curiosity and gratitude, and even joy. Try these one at a time as you get to do each task on your Short List. + +You’ll find that you’re not so overloaded, but that each task is just perfect for that moment. And that’s a completely new relationship with the work that you do, and a new relationship with life. diff --git a/themes/archie/exampleSite/content/posts/post-2.md b/themes/archie/exampleSite/content/posts/post-2.md new file mode 100644 index 0000000..54f4fde --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-2.md @@ -0,0 +1,40 @@ +--- +title: "Fearlessness: How to Stop Running from Space" +date: 2018-03-18T12:13:30+05:30 +tags: [Space] +--- + +We spend our days filling in every available space, cramming in more tasks, responding to messages, checking social media and online sites, watching videos. + +We are afraid of empty space in our lives. + +The result is often a continual busyness, constant distraction and avoidance, lack of focus, lack of satisfaction with our lives. + +We run from silence. We run from the spaces between tasks and appointments. We run from solitude and stillness. We try to fill every second with activity, with something useful, as if silence and space are not valuable. + +But what are we afraid of? + +And who would we be if we didn’t have that fear? + +We’re afraid of space and stillness and silence because it highlights the uncertainty, instability, groundlessness, insecurity, shakiness that lie underneath every second of our lives. We’re afraid of having to face this instability and uncertainty, of having to feel the fear of it. + +Without the fear of all of the uncertainty that is highlighted by space … we become free. + +I know in my life, when I allow myself to have stillness, silence, solitude, simplicity and space … it leaves room to face whatever is coming up for me. It gives me room to fully feel any feelings that I’ve been avoiding. It allows me to be more honest with myself, instead of using distractions and busyness to cover up what I don’t want to see. + +And in the end, I develop trust that the space is not something to be feared, but rather something to be treasured. A gift, filled with learning and not knowing and shakiness and beauty. + +You might try allowing more space to be in your day, without filling it: + +* Take some time between tasks for stillness. +* Sit out in nature, in silence, without technology. +* When you notice yourself reaching for your phone, pause. See if you can just be still, just savor some space. +* When you feel uncertainty or instability in your life (hint: it’s always there), let yourself feel it. Be present with it, without needing to run or avoid. +* When you feel fear, be open-hearted with it and allow yourself fully feel it, being friendly with it. Your relationship with fear will change if you become friendly with it. +* Do less, and trust that things won’t fall apart. Or if they do fall apart, you can be present with that instability. +* When you’re in line, driving, eating, walking, exercising … see if you can do those things in silence, without technology, without needing to do something “useful.” Find the value in these spaces. +* Notice who you are without the fear of space. + +Savor these spaces, their deliciousness. Savor the groundlessness, as something filled with freedom if we learn not to fear it. Be present with the fear and uncertainty, as good friends not as enemies. + +Let your heart be open raw tender and vulnerable, and your mind embracing the spaciousness of the vast blue sky of open awareness. diff --git a/themes/archie/exampleSite/content/posts/post-3.md b/themes/archie/exampleSite/content/posts/post-3.md new file mode 100644 index 0000000..2eb633f --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-3.md @@ -0,0 +1,38 @@ +--- +title: "How I Learned to Stop Procrastinating, & Love Letting Go" +date: 2018-03-18T12:13:32+05:30 +description: "The art of letting go." +tags: [Procrastinating] +--- + +The end of procrastination is the art of letting go. + +I’ve been a lifelong procrastinator, at least until recent years. I would put things off until deadline, because I knew I could come through. I came through on tests after cramming last minute, I turned articles in at the deadline after waiting until the last hour, I got things done. + +Until I didn’t. It turns out procrastinating caused me to miss deadlines, over and over. It stressed me out. My work was less-than-desirable when I did it last minute. Slowly, I started to realize that procrastination wasn’t doing me any favors. In fact, it was causing me a lot of grief. + +But I couldn’t quit. I tried a lot of things. I tried time boxing and goal setting and accountability and the Pomodoro Technique and Getting Things Done. All are great methods, but they only last so long. Nothing really worked over the long term. + +That’s because I wasn’t getting to the root problem. + +I hadn’t figured out the skill that would save me from the procrastination. + +Until I learned about letting go. + +Letting go first came to me when I was quitting smoking. I had to let go of the “need” to smoke, the use of my crutch of cigarettes to deal with stress and problems. + +Then I learned I needed to let go of other false needs that were causing me problems: sugar, junk food, meat, shopping, beer, possessions. I’m not saying I can never do these things again once I let go of these needs, but I let go of the idea that they’re really necessary. I let go of an unhealthy attachment to them. + +Then I learned that distractions and the false need to check my email and news and other things online … were causing me problems. They were causing my procrastination. + +So I learned to let go of those too. + +Here’s the process I used to let go of the distractions and false needs that cause procrastination: + +I paid attention to the pain they cause me, later, instead of only the temporary comfort/pleasure they gave me right away. +I thought about the person I want to be, the life I want to live. I set my intentions to do the good work I think I should do. +I watched my urges to check things, to go to the comfort of distractions. I saw that I wanted to escape discomfort of something hard, and go to the comfort of something familiar and easy. +I realized I didn’t need that comfort. I could be in discomfort and nothing bad would happen. In fact, the best things happen when I’m in discomfort. +And then I smile, and breathe, and let go. + +And one step at a time, become the person I want to be. diff --git a/themes/archie/exampleSite/content/posts/post-4.md b/themes/archie/exampleSite/content/posts/post-4.md new file mode 100644 index 0000000..e6609a7 --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-4.md @@ -0,0 +1,30 @@ +--- +title: "Getting Started with Traveling Ultralight" +date: 2020-03-18T12:13:35+05:30 +description: "Start by getting a small backpack (less than 20 liters) and then just travel with what fits in that." +--- + +I’m on a trip at the moment, and a friend who generously let me sleep on his couch looked at my small travel backpack and commented on how little I travel with: “That’s impressive,” he said. + +I was a little surprised, because though I’ve gotten that comment before, it’s become normal for me to travel with just a small bag (10 lbs. or less, usually), and I have friends who travel with even less. But then I remembered that I’m far from normal in this way. + +I gave him a tip for getting started, and I recommend it for all of you, who want to travel light — or ultralight, as I call it, because for many people traveling light is taking a carry-on roller luggage. For me, having those roller bags is lugging too much, because you can run up stairs with it with ease, or carry it all over a city without worrying about stowing away your luggage somewhere first. It’s so much easier to travel ultralight. + +Here’s the tip I gave him to get started: start by getting a small backpack (less than 20 liters) and then just travel with what fits in that. + +That’s how to start. But you’ll probably want some guidance on what to put into the bag, and how to travel with so little. Here’s some guidance to get started: + +* I travel with a lightweight laptop (Macbook Air), a few clothes, my phone, earbuds and some charging cords, toiletries, and almost nothing else. A lightweight windbreaker for wind and light rain (Patagonia Houdini). An eye mask and ear plugs. A collapsible water bottle. My passport. That’s about it. No extra shoes. No books. No suit. No travel pillow. No extra camera other than my phone. I’m not sure what else everyone else brings, but none of that. +* I bring clothes that I can wash in the sink or shower and that will dry overnight. Lightweight stuff that I can layer. Often they’re workout-style clothes or things from companies like Outlier or Patagonia that travel well. I don’t bring enough underwear or socks for every day of the trip, because I wash them every couple of days. I only bring one or two extra T-shirts, generally wearing the same two shirts the whole trip, even if it’s a month long. No one has ever once cared what I wear when I’m traveling. +* I bring minimal toiletries: a small shaver for my head, razor, toothbrush, floss small tubes of toothpaste and shaving cream, deodorant, nail clippers, ibuprofen. +* For cold places, I have thermal underwear and a couple long-sleeve layers (generally all Patagonia capilene stuff), and a beanie. I don’t usually go to places where it’s snowing (I don’t know why, maybe snow isn’t my thing), so I don’t have clothes to deal with that weather. +* For warm places, I will bring flip flops and swim trunks, and leave most of the colder layers behind. + +That’s enough for a monthlong trip, which I’ve done multiple times with this kind of setup. For a shorter trip of a few days, I might bring even less. + +I really love traveling this way, and am more than willing to sacrifice bringing extra things for the luxury of traveling lightweight. + +By the way, you don’t need much more than this kind of setup even in everyday life. + +For more info on this, check out my Ultralight ebook, and my friend Tynan has a great book called Forever Nomad. + diff --git a/themes/archie/exampleSite/content/posts/post-5.md b/themes/archie/exampleSite/content/posts/post-5.md new file mode 100644 index 0000000..8623c19 --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-5.md @@ -0,0 +1,75 @@ +--- +title: "Typography" +date: 2018-03-18T12:13:38+05:30 +--- + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +# Heading 1 + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +## Heading 2 + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +### Heading 3 + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +#### Heading 4 + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +##### Heading 5 + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +###### Heading 6 + +Lid est laborum et dolorum fuga. Et harum quidem rerum facilis est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit quo minus id quod amets untra dolor amet sad. Sed ut perspser iciatis unde omnis iste natus error sit voluptatem accusantium doloremque laste. Dolores sadips ipsums sits. + +## Typography + +Lid est laborum et dolorum fuga, This is [an example](http://example.com/ "Title") inline link. Et harum quidem rerum facilis, **This is bold** and *emphasis* cumque nihilse impedit quo minus id quod amets untra dolor amet sad. While this is `code block()` and following is a `pre` tag + + print 'this is pre tag' + +Following is the syntax highlighted code block + +```go +func getCookie(name string, r interface{}) (*http.Cookie, error) { + rd := r.(*http.Request) + cookie, err := rd.Cookie(name) + if err != nil { + return nil, err + } + return cookie, nil +} + +func setCookie(cookie *http.Cookie, w interface{}) error { + // Get write interface registered using `Acquire` method in handlers. + wr := w.(http.ResponseWriter) + http.SetCookie(wr, cookie) + return nil +} +``` + +This is blockquote, Will make it *better now* + +> 'I want to do with you what spring does with the cherry trees.' cited ~Pablo Neruda* + + +> Et harum quidem *rerum facilis* est et expeditasi distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihilse impedit + +Unordered list + +* Red +* Green +* Blue + +Ordered list + +1. Red +2. Green +3. Blue diff --git a/themes/archie/exampleSite/content/posts/post-6.md b/themes/archie/exampleSite/content/posts/post-6.md new file mode 100644 index 0000000..0a29764 --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-6.md @@ -0,0 +1,36 @@ +--- +title: "Hugo shortcodes" +date: 2018-03-18T12:13:36+05:30 +description: Here is a demo of all shortcodes available in Hugo. +--- + +## Images + +{{< figure src="https://images.unsplash.com/photo-1560032779-0a8809186efd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80" title="Dave Herring" >}} + +{{< figure src="https://images.unsplash.com/photo-1560032779-0a8809186efd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80" title="Dave Herring" >}} + + +## Github Gist + +{{< gist spf13 7896402 >}} + +## Youtube video + +{{< youtube w7Ft2ymGmfc >}} + +## Tweet + +{{< tweet 877500564405444608 >}} + +## Vimeo + +{{< vimeo id="146022717" >}} + +## Instagram + +{{< instagram BWNjjyYFxVx >}} + +## Callouts + +{{< callout emoji="⚡️" text="I guess this works" >}} \ No newline at end of file diff --git a/themes/archie/exampleSite/content/posts/post-7.md b/themes/archie/exampleSite/content/posts/post-7.md new file mode 100644 index 0000000..4884040 --- /dev/null +++ b/themes/archie/exampleSite/content/posts/post-7.md @@ -0,0 +1,15 @@ +--- +title: "How to test dark mode?" +summary: "Here is how you can setup dark mode for Ink and test on various OS like iOS, Android, macOS and Windows 10." +date: 2018-03-18T12:13:38+05:30 +tldr: "Wubba lubba dub dub" +--- + +You can set dark mode as default by setting `params.mode` to `dark` in `config.toml` or set it to `auto` which will detect based on your OS and switch to dark mode. For more details [refer documentation](https://github.com/knadh/hugo-ink#configuration) + +Here is how you can switch based on your OS + +* [iOS](https://www.howtogeek.com/440078/how-to-enable-dark-mode-on-your-iphone-and-ipad/) +* [Android](https://9to5google.com/2018/12/17/android-dark-mode-theme-pie/) +* [macOS](https://support.apple.com/en-in/HT208976) +* [Windows 10](https://www.cnet.com/how-to/turn-on-the-dark-mode-in-windows-10/) diff --git a/themes/archie/exampleSite/content/posts/tg-gh.md b/themes/archie/exampleSite/content/posts/tg-gh.md new file mode 100644 index 0000000..4400148 --- /dev/null +++ b/themes/archie/exampleSite/content/posts/tg-gh.md @@ -0,0 +1,382 @@ +--- +title: Telegram Bot for GitHub Actions +date: "2020-04-01" +description: Make a Telegram bot with Node.js and use it with GitHub Actions for sending notifications to you about the repo. +tldr: Making GitHub Actions with Js Code +--- +## Telegram +[Telegram](https://telegram.org/) is a cloud-based mobile and desktop messaging app with a focus on security and speed. It is free to use and extensively hackable. It also has a good bot support system. The API is also easy to implement and has many wrappers for building bots with the API. + +## GitHub Actions +[GitHub Actions](https://github.com/features/actions) is a CI/CD runtime for your GitHub repository. You can run almost anything from scripts to docker containers. You can build, test and deploy your code with GitHub Actions. All these actions are called workflows and workflows differ in the job they're doing. These maybe test workflows, build ones or deployment ones. You can find all the actions on GitHub in the [marketplace](https://github.com/marketplace?type=actions) + +## Building the Bot +### Prerequisites +- Basic JavaScript Knowledge +- Basic GitHub Knowledge +- Telegram Account + +> There are templates for building actions. Here we're gonna start from scratch + +### Environment Setup +- **Node**, You can download node from their [website](https://nodejs.org/en/download/) +- NPM comes with node, so you don't have to worry about it. +- Initialize the Project +```shell +$ git init ## initialize a new git repository for version management +--- +$ npm init +``` +- **dotenv**, Dotenv can be downloaded via +```shell +$ npm i dotenv +--- +$ yarn add dotenv +``` +- **node-telegram-bot-api**, node-telegram-bot-api is a simple wrapper for building telegram bots. You can download it via +```shell +$ npm i node-telegram-bot-api +--- +$ yarn add node-telegram-bot-api +``` +- **@zeit/ncc**, NCC is a Simple CLI for compiling a Node.js module into a single file, together with all its dependencies, GCC-style. It's a dev dependency and can be downloaded +```shell +yarn add --dev @zeit/ncc +--- +npm i -D @zeit/ncc +``` + + +#### Folder Structure +The `dist` folder will be automatically created. `action.yml` will be made + +``` +. +├── dist +│ └── index.js +├── index.js +├── action.yml +├── README.md +└── package.json + +``` +- `index.js` is the file we're defining the bot +- `action.yml` is the file we'll define the action and it's behaviours + +## Making the Bot +We need to get an API bot token from telegram. For that Go to Telegram and Search for `Botfather`. It's a bot. +![](bfather.png) +Create a new bot with the `/newbot` command and get the API key. We'll need that, also talk to `jsondump` bot and get your chat id. The output may be like this, so +```json +{ + "update_id": 143943779, + "message": { + "message_id": 181575, + "from": { + "id": 123456 // this is what we need + "is_bot": false, + "first_name": "Tg Name", + "username": "TG Username", + "language_code": "en" + }, + "chat": { + "id": 123456, + "first_name": "Tg Name", + "username": "TG Username", + "type": "private" + }, + "date": 1584119424, + "text": "message" + } +} +``` +This will be needed for further use and We need to add it to the repo secrets which can be found in the repo settings. Be careful to add it as `token` and `chat` like as shown below +![](scr.png) + +### Writing the Action and Building the Bot +Fire up the terminal/cmd and make a new folder. Install the dependencies. Run the following command +```shell +$ touch index.js action.yml +``` +Open your favourite text editor within the folder or with the file. We'll define the bot in `index.js` + +```javaScript +require("dotenv").config +const Bot = require('node-telegram-bot-api'); +const { + INPUT_STATUS: ipstatus, + INPUT_TOKEN: tgtoken,//Telegram api token + INPUT_CHAT: chatid,// Telegram Chat ID + INPUT_IU_TITLE: ititle,// Issue title + INPUT_IU_NUM: inum,// Issue Number + INPUT_IU_ACTOR: iactor,// Issue made by + INPUT_IU_BODY: ibody,// Issue Body + INPUT_PR_NUM: pnum,// PR Number + INPUT_PR_STATE: prstate,// PR Opened, reponed or closed + INPUT_PR_TITLE: ptitle,// PR Title + INPUT_PR_BODY: pbody,// Body of the PR + GITHUB_EVENT_NAME: ghevent,// Name of the trigger event + GITHUB_REPOSITORY: repo,// Repository the trigger was made from + GITHUB_ACTOR: ghactor,// User who triggered the action + GITHUB_SHA: sha,// Commit ID + GITHUB_WORKFLOW: ghwrkflw// Workflow Name +} = process.env; + +const bot = new Bot(tgtoken) +``` +First, we're defining the dotenv for config and initializing Telegram Bot. Here we're defining the alias variables for the *environment variables*. You might notice an `INPUT_` for almost every environment variable, this is because GitHub Actions pass the env variable with an INPUT prefix. Other env variables are action's default environment variables. Then we initialized the bot with the API token. + +GitHub actions could be triggered with Issues, Pull Request or Pushes. You can find the trigger events [here](https://help.github.com/en/actions/reference/events-that-trigger-workflows). Here we're gonna get a message from the bot when an *Issue* or *Pull Request* or a *Push* event has happened. + +```js +const evresp = (gevent) => { + switch (gevent) { + + case "issues": + return ` +❗️❗️❗️❗️❗️❗️ + +Issue ${prstate} + +Issue Title and Number : ${ititle} | #${inum} + +Commented or Created By : \`${iactor}\` + +Issue Body : *${ibody}* + +[Link to Issue](https://github.com/${repo}/issues/${inum}) +[Link to Repo ](https://github.com/${repo}/) +[Build log here](https://github.com/${repo}/commit/${sha}/checks)` + case "pull_request": + return ` +🔃🔀🔃🔀🔃🔀 +PR ${prstate} + +PR Number: ${pnum} + +PR Title: ${ptitle} + +PR Body: *${pbody}* + +PR By: ${ghactor} + +[Link to Issue](https://github.com/${repo}/pull/${pnum}) +[Link to Repo ](https://github.com/${repo}/) +[Build log here](https://github.com/${repo}/commit/${sha}/checks)` + default: + return ` +⬆️⇅⬆️⇅ + +ID: ${ghwrkflw} + +Action was a *${ipstatus}!* + +\`Repository: ${repo}\` + +On: *${ghevent}* + +By: *${ghactor}* + +Tag: ${process.env.GITHUB_REF} + +[Link to Repo ](https://github.com/${repo}/) + ` + } +} +``` +In these lines of code, we're just initializing a switch statement for the responses. We're also declaring an anonymous function to use the switch responses via a function later. We're using all the defined variables in the switch. You can check the [trigger Events](https://help.github.com/en/actions/reference/events-that-trigger-workflows) to get how the event is triggered and what keyword should be used. + +Now for the last part of the Js file, we just take the response from the switch and assign it to a constant. Then we use the `sendMessage` function of the `node-telegram-bot-api` to send the message to the bot with the chatid and the output as the arguments. +```js +const output = evresp(ghevent) +``` +bot.sendMessage(chatid,output,{parse_mode : "Markdown"}) +## Compiling and Minifying the Js code +Since we have installed `@zeit/ncc` and this is used for the making the whole program with all the APIs to a single file and we need to use NCC for that. We just need to run +```shell +yarn run ncc build index.js -C -m -o dist +``` +or you might wanna add the following to you `package.json` file, and run `npm run test` to compile and minify the code. +```json +"scripts": { + "test": "ncc build index.js -C -m -o dist" + }, +``` +This will create a `dist` folder with and `index.js` file which contains the compiled code. + +## Making it a valid action +For making this Js file a valid action, we need to add an `action.yml` file. The action.yml for this action is like this +```yml +name: 'Action Name' +description: 'Action Descreption' +author: '' +inputs: + chat: + description: 'Chat to send: chat id or @channel_name' + required: true + token: + description: 'Telegram Bot token' + required: true + status: + description: 'Job status' + required: true + iu_title: + description: 'Issue Title' + default: ${{ github.event.issue.title }} + iu_num: + description: 'Issue Number' + default: ${{ github.event.issue.number }} + iu_actor: + description: 'Issue Triggerer' + default: ${{ github.event.issue.user.login }} + iu_com: + description: 'Issue Comment' + default: ${{github.event.comment.body}} + pr_state: + description: 'State of the PR' + default: ${{ github.event.action }} + pr_num: + description: 'PR Number' + default: ${{ github.event.number }} + pr_title: + description: 'Title of the PR' + default: ${{ github.event.pull_request.title }} + pr_body: + description: 'Body/Contents of the PR' + default: ${{ github.event.pull_request.body }} +runs: + using: "node12" + main: "dist/index.js" +branding: + icon: 'repeat' + color: 'green' +``` +Here we're defining the Input variables to be loaded for the action in GitHub's runtime environemt. All these `default` data are taken from the response of the webhooks which are send by GitHub when a trigger event is occured. You can find out more in the [Action Documentation Here](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context). + +```yml +runs: + using: "node12" + main: "dist/index.js" +``` +Here we are defining that this is a node action and should run in an environment with node, and the file which should be run, here the `index.js` file in the `dist` folder. That should do it. Create a new commit and push it to a repo. **Create a new tag** and this action will appear in the [marketplace](https://github.com/marketplace?type=actions). + +### Defining a workflow to test your action +GitHub Action workflows are defined using the `.yml` syntax. Here is an example of a sample workflow for this action + +```yml +name: + +on: + push: + pull_request: + types: [opened, closed] + issues: + types: [opened, closed, reopened] +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: + uses: /@master + if: always() + with: + chat: ${{ secrets.chat }} + token: ${{ secrets.token }} + status: ${{ job.status }} +``` + + +The Complete code for the bot is +```js +//Initializing dotenv and the bot +require("dotenv").config +const Bot = require('node-telegram-bot-api'); +// aliasing the environment variables +const { + INPUT_STATUS: ipstatus, + INPUT_TOKEN: tgtoken, //Telegram api token + INPUT_CHAT: chatid,// Telegram Chat ID + INPUT_IU_TITLE: ititle,// Issue title + INPUT_IU_NUM: inum,// Issue Number + INPUT_IU_ACTOR: iactor, // Issue made by + INPUT_IU_BODY: ibody, // Issue Body + INPUT_PR_NUM: pnum, // PR Number + INPUT_PR_STATE: prstate, // PR Opened, reponed or closed + INPUT_PR_TITLE: ptitle, // PR Title + INPUT_PR_BODY: pbody, // Body of the PR + GITHUB_EVENT_NAME: ghevent, // Name of the trigger event + GITHUB_REPOSITORY: repo, // Repository the trigger was made from + GITHUB_ACTOR: ghactor, // User who triggered the action + GITHUB_SHA: sha, // Commit ID + GITHUB_WORKFLOW: ghwrkflw // Workflow Name +} = process.env; + +const bot = new Bot(tgtoken) +// Function to return the response for the specific trigger +const evresp = (gevent) => { + switch (gevent) { +//Switch statement for issues + case "issues": + return ` +❗️❗️❗️❗️❗️❗️ + +Issue ${prstate} + +Issue Title and Number : ${ititle} | #${inum} + +Commented or Created By : \`${iactor}\` + +Issue Body : *${ibody}* + +[Link to Issue](https://github.com/${repo}/issues/${inum}) +[Link to Repo ](https://github.com/${repo}/) +[Build log here](https://github.com/${repo}/commit/${sha}/checks)` +// Switch statement for Pull Requests + case "pull_request": + return ` +🔃🔀🔃🔀🔃🔀 +PR ${prstate} + +PR Number: ${pnum} + +PR Title: ${ptitle} + +PR Body: *${pbody}* + +PR By: ${ghactor} + +[Link to Issue](https://github.com/${repo}/pull/${pnum}) +[Link to Repo ](https://github.com/${repo}/) +[Build log here](https://github.com/${repo}/commit/${sha}/checks)` + default: +// switch statement for Pushes + return ` +⬆️⇅⬆️⇅ + +ID: ${ghwrkflw} + +Action was a *${ipstatus}!* + +\`Repository: ${repo}\` + +On: *${ghevent}* + +By: *${ghactor}* + +Tag: ${process.env.GITHUB_REF} + +[Link to Repo ](https://github.com/${repo}/) + ` + } +} +// assigning the output to a variable +const output = evresp(ghevent) +// sending the message +bot.sendMessage(chatid,output,{parse_mode : "Markdown"}) +``` + + +------ + +You can try out many different items using actions and this is just a sample action to get you started. Maybe sending Cat GIFs if the build succeded on the pull request or sending a welcome message to a first time contributor. You imagination is the limit😄 and **Never Stop being ⚡️** \ No newline at end of file diff --git a/themes/archie/images/archie-dark.png b/themes/archie/images/archie-dark.png new file mode 100644 index 0000000..2bff9ed Binary files /dev/null and b/themes/archie/images/archie-dark.png differ diff --git a/themes/archie/images/screenshot.png b/themes/archie/images/screenshot.png new file mode 100644 index 0000000..1a262e7 Binary files /dev/null and b/themes/archie/images/screenshot.png differ diff --git a/themes/archie/images/theme.png b/themes/archie/images/theme.png new file mode 100644 index 0000000..c195540 Binary files /dev/null and b/themes/archie/images/theme.png differ diff --git a/themes/archie/images/tn.png b/themes/archie/images/tn.png new file mode 100644 index 0000000..628ac6c Binary files /dev/null and b/themes/archie/images/tn.png differ diff --git a/themes/archie/layouts/404.html b/themes/archie/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/archie/layouts/_default/baseof.html b/themes/archie/layouts/_default/baseof.html new file mode 100644 index 0000000..b941097 --- /dev/null +++ b/themes/archie/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + + {{- partial "header.html" . -}} + +
+ {{- partial "head.html" . -}} + {{- block "main" . }}{{- end }} + {{- partial "footer.html" . -}} +
+ + diff --git a/themes/archie/layouts/_default/list.html b/themes/archie/layouts/_default/list.html new file mode 100644 index 0000000..41a4c6f --- /dev/null +++ b/themes/archie/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ if isset .Data "Term" }} +

Entries tagged - "{{ .Data.Term }}"

+{{ else }} +

All articles

+{{ end }} + +
    + {{- range .Data.Pages -}} + {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} +
  • + {{.Title}} {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} DRAFT {{ end }} +
  • + {{- end -}} + {{- end -}} +
+{{ end }} diff --git a/themes/archie/layouts/_default/single.html b/themes/archie/layouts/_default/single.html new file mode 100644 index 0000000..e072801 --- /dev/null +++ b/themes/archie/layouts/_default/single.html @@ -0,0 +1,33 @@ +{{ define "main" }} +
+
+
+

{{ .Title }}

+
Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} DRAFT {{ end }}
+
+ {{ if isset .Params "tldr" }} +
+ tl;dr: + {{ .Params.tldr }} +
{{ end }} + +
+ {{ .Content }} +
+ + +
+
+{{ end }} diff --git a/themes/archie/layouts/_default/term.html b/themes/archie/layouts/_default/term.html new file mode 100644 index 0000000..41a4c6f --- /dev/null +++ b/themes/archie/layouts/_default/term.html @@ -0,0 +1,17 @@ +{{ define "main" }} +{{ if isset .Data "Term" }} +

Entries tagged - "{{ .Data.Term }}"

+{{ else }} +

All articles

+{{ end }} + +
    + {{- range .Data.Pages -}} + {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} +
  • + {{.Title}} {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} DRAFT {{ end }} +
  • + {{- end -}} + {{- end -}} +
+{{ end }} diff --git a/themes/archie/layouts/_default/terms.html b/themes/archie/layouts/_default/terms.html new file mode 100644 index 0000000..fea9c2f --- /dev/null +++ b/themes/archie/layouts/_default/terms.html @@ -0,0 +1,20 @@ +{{ define "main" }} +

All tags

+ +{{ $biggest := 1 }} +{{ $smallest := 1 }} +{{ $max := 3 }} +{{ $min := 1 }} +{{ $size := $min }} + +{{ $data := .Data }} +
+
    + {{ range $key, $value := .Data.Terms.ByCount }} + {{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }} + {{ $size := (cond (eq $biggest $smallest) $min $size) }} +
  • {{ $value.Name }}
  • + {{ end }} +
+
+{{ end }} diff --git a/themes/archie/layouts/index.html b/themes/archie/layouts/index.html new file mode 100644 index 0000000..ac7eab1 --- /dev/null +++ b/themes/archie/layouts/index.html @@ -0,0 +1,21 @@ + + + {{ partial "header.html" . }} + +
+ {{ partial "head.html" . }} + +
+
+
+ {{ .Content }} +
+ +
+
+ + {{ partial "footer.html" . }} +
+ + + diff --git a/themes/archie/layouts/partials/footer.html b/themes/archie/layouts/partials/footer.html new file mode 100644 index 0000000..6063791 --- /dev/null +++ b/themes/archie/layouts/partials/footer.html @@ -0,0 +1,42 @@ +
+
+{{- range $index, $key := .Site.Params.Social -}} +| +{{- end -}} ⚡️ + +{{ dateFormat "2006" now }} {{ with .Site.Copyright }} {{ . }} | {{ end }} Archie Theme + +| Built with Hugo | + + +{{- range $index, $key := .Site.Params.donations -}} +| +{{- end -}} + +
+{{ if not .Site.IsServer }} + + + + +{{ end }} + +{{- if (isset .Site.Params "social") -}} + +{{- end -}} diff --git a/themes/archie/layouts/partials/head.html b/themes/archie/layouts/partials/head.html new file mode 100644 index 0000000..20fde3e --- /dev/null +++ b/themes/archie/layouts/partials/head.html @@ -0,0 +1,11 @@ +
+ + +
diff --git a/themes/archie/layouts/partials/header.html b/themes/archie/layouts/partials/header.html new file mode 100644 index 0000000..7234f29 --- /dev/null +++ b/themes/archie/layouts/partials/header.html @@ -0,0 +1,66 @@ + + + + {{- $title := ( .Title ) -}} + {{- $siteTitle := ( .Site.Title ) -}} + {{- if .IsHome -}} + {{ $siteTitle }} | Home + {{- else -}} + {{ $title }} - {{ $siteTitle }} + {{- end -}} + + {{- if isset .Site.Params "favicon" -}} + + {{- end -}} + + + + + + + + + + + + + + + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + + {{- template "_internal/opengraph.html" . -}} + {{- template "_internal/twitter_cards.html" . -}} + {{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}} + + {{- else if (isset .Site.Params "social") -}} + + {{ end }} + {{ if .Site.Params.useCDN | default false -}} + + + + {{- else -}} + + {{ end }} + + {{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}} + + {{ end }} + + {{- if isset .Site.Params "customcss" }} + {{ range .Site.Params.customCSS }} + + {{ end }} + {{- end -}} + {{- range .Site.Params.customJS }} + {{- if or (hasPrefix . "http://") (hasPrefix . "https://") }} + + {{- else }} + + {{- end }} + {{- end }} + + diff --git a/themes/archie/layouts/partials/paginator.html b/themes/archie/layouts/partials/paginator.html new file mode 100644 index 0000000..5acc06d --- /dev/null +++ b/themes/archie/layouts/partials/paginator.html @@ -0,0 +1,15 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} +
    + + {{ if $pag.HasPrev }} + + {{ end }} + + + {{ if $pag.HasNext }} + + {{ end }} + +
+{{ end }} diff --git a/themes/archie/layouts/shortcodes/callout.html b/themes/archie/layouts/shortcodes/callout.html new file mode 100644 index 0000000..5557aad --- /dev/null +++ b/themes/archie/layouts/shortcodes/callout.html @@ -0,0 +1,6 @@ + +
+
+ 💡 {{ .Get "text" }} +
+
\ No newline at end of file diff --git a/themes/archie/static/css/dark.css b/themes/archie/static/css/dark.css new file mode 100644 index 0000000..a1ac971 --- /dev/null +++ b/themes/archie/static/css/dark.css @@ -0,0 +1,163 @@ +body { + color: white; + background-color: #202124; +} + +::-moz-selection { + background: blue; + color: #fff; + text-shadow: none; +} + +::selection { + background: red; + color: #fff; + text-shadow: none; +} + +hr { + border-top: 3px dotted blue; +} +code { + background-color: lightblue; + color: black; + text-decoration: bold; + padding: 0.1em 0.2em; +} +pre { + background-color: #272822; + line-height: 1.4; + overflow-x: auto; + padding: 1em; +} +blockquote { + border-color: blue; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + color: #ddd; +} +h1::before { + color: var(--darkMaincolor); + content: "# "; +} +h2::before { + color: var(--darkMaincolor); + content: "## "; +} +h3::before { + color: var(--darkMaincolor); + content: "### "; +} +h4::before { + color: var(--darkMaincolor); + content: "#### "; +} +h5::before { + color: var(--darkMaincolor); + content: "##### "; +} +h6::before { + color: var(--darkMaincolor); + content: "###### "; +} + +a { + border-bottom: 3px solid var(--darkMaincolor); + color: inherit; +} +a:hover { + background-color: var(--darkMaincolor); + color: black; +} + +.site-description a { + color: #ddd; +} +.site-description a:hover { + color: black; +} + +.tags a { + border-bottom: 3px solid var(--darkMaincolor); +} +.tags a:hover { + background-color: var(--darkMaincolor); + color: black; +} + +.site-title a { + color: white; + text-decoration: none !important; +} + +.header nav, +.footer { + border-color: #333; +} + +.highlight { + background-color: #333; +} +.soc { + padding-left: 10px; + padding-right: 10px; +} +.soc:hover { + color: black; +} +.draft-label { + color: var(--darkMaincolor); + background-color: blue; +} +.highlight pre code[class=language-javaScript]::before, +.highlight pre code[class="language-js"]::before { + content: "js"; + background: #f7df1e; + color: black; +} +.highlight pre code[class*='language-yml']::before, +.highlight pre code[class*='language-yaml']::before { + content: 'yaml'; + background: #f71e6a; + color: white; +} +.highlight pre code[class*='language-shell']::before, +.highlight pre code[class*='language-bash']::before, +.highlight pre code[class*='language-sh']::before { + content: 'shell'; + background: green; + color:white +} +.highlight pre code[class*='language-json']::before{ + content: 'json'; + background: dodgerblue; + color: #000000 +} +.highlight pre code[class*='language-python']::before, +.highlight pre code[class*='language-py']::before { + content: 'py'; + background: blue; + color: yellow ; +} +.highlight pre code[class*='language-css']::before{ + content: 'css'; + background: cyan; + color: black ; +} +.highlight pre code[class*='language-go']::before{ + content: 'Go'; + background: cyan; + color: royalblue ; +} +.highlight pre code[class*='language-md']::before, +.highlight pre code[class*='language-md']::before{ + content: 'Markdown'; + background: royalblue; + color: whitesmoke ; +} diff --git a/themes/archie/static/css/fonts.css b/themes/archie/static/css/fonts.css new file mode 100644 index 0000000..156ee63 --- /dev/null +++ b/themes/archie/static/css/fonts.css @@ -0,0 +1,38 @@ +/* fira-sans-regular - latin */ +@font-face { + font-family: 'Fira Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/fira-sans-v10-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Fira Sans Regular'), local('FiraSans-Regular'), + url('../fonts/fira-sans-v10-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/fira-sans-v10-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/fira-sans-v10-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/fira-sans-v10-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/fira-sans-v10-latin-regular.svg#FiraSans') format('svg'); /* Legacy iOS */ +} +/* roboto-mono-regular - latin */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + src: url('../fonts/roboto-mono-v12-latin-regular.eot'); /* IE9 Compat Modes */ + src: url('../fonts/roboto-mono-v12-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/roboto-mono-v12-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/roboto-mono-v12-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/roboto-mono-v12-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/roboto-mono-v12-latin-regular.svg#RobotoMono') format('svg'); /* Legacy iOS */ +} +/* ibm-plex-mono-500italic - latin */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: italic; + font-weight: 500; + src: url('../fonts/ibm-plex-mono-v6-latin-500italic.eot'); /* IE9 Compat Modes */ + src: local('IBM Plex Mono Medium Italic'), local('IBMPlexMono-MediumItalic'), + url('../fonts/ibm-plex-mono-v6-latin-500italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/ibm-plex-mono-v6-latin-500italic.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/ibm-plex-mono-v6-latin-500italic.woff') format('woff'), /* Modern Browsers */ + url('../fonts/ibm-plex-mono-v6-latin-500italic.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/ibm-plex-mono-v6-latin-500italic.svg#IBMPlexMono') format('svg'); /* Legacy iOS */ +} diff --git a/themes/archie/static/css/main.css b/themes/archie/static/css/main.css new file mode 100644 index 0000000..97bbe5d --- /dev/null +++ b/themes/archie/static/css/main.css @@ -0,0 +1,293 @@ +/* Markdown */ +:root{ +--maincolor: red; +--bordercl:rebeccapurple; +--callouctcolor:dodgerblue; +--hovercolor:navy; +--darkMaincolor: #50fa7b; +} +html { + color: #232333; + font-family: 'Roboto Mono', monospace; + font-size: 15px; + line-height: 1.6em; +} +body{ + display: block; + margin: 8px; +} +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +::selection { + background: var(--maincolor); + color: #fff; +} + +p { + font-family: 'Fira Sans', sans-serif; + line-height: 1.5; +} + +hr { + border: 0; + border-top: 3px dotted var(--bordercl); + margin: 1em 0; +} + +blockquote { + border-left: 3px solid var(--bordercl); + color: #737373; + margin: 0; + padding-left: 1em; +} + +a { + border-bottom: 3px solid var(--maincolor); + color: inherit; + text-decoration: none; +} +a:hover { + background-color: var(--hovercolor); + color: #fff; +} + +ul { + list-style: none; + padding-left: 2ch; +} +ul li { + text-indent: -2ch; +} +ul li::before { + content: '* '; + font-weight: bold; +} + +/* Images */ +img { + border: 3px solid #ececec; + max-width: 100%; +} + +figure { + box-sizing: border-box; + display: inline-block; + margin: 0; + max-width: 100%; +} + +figure img { + max-height: 500px; +} + +@media screen and (min-width: 600px) { + figure { + padding: 0 40px; + } +} + +figure h4 { + font-size: 1rem; + margin: 0; + margin-bottom: 1em; +} +figure h4::before { + content: '↳ '; +} + +/* Code blocks */ +code { + background-color: #f1f1f1; + padding: .1em .2em; +} + +pre { + background-color: #ececec; + line-height: 1.4; + overflow-x: auto; + padding: 1em; +} + +.highlight pre ::selection { + background: rgba(255, 255, 255, 0.2); + color: inherit; +} + +pre code { + background-color: transparent; + color: inherit; + font-size: 100%; + padding: 0; +} + +/* Containers */ +.content { + margin-bottom: 4em; + margin-left: auto; + margin-right: auto; + max-width: 800px; + padding: 0 1ch; + word-wrap: break-word; +} + +/* Header */ +header { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + margin: 1em 0; +} + +header .main { + font-size: 1.5rem; +} +h1, h2, h3, h4, h5, h6 { + font-size: 1.2rem; + margin-top: 2em; +} + +h1::before { color: var(--maincolor); content: '# '; } +h2::before { color: var(--maincolor); content: '## '; } +h3::before { color: var(--maincolor); content: '### '; } +h4::before { color: var(--maincolor); content: '#### '; } +h5::before { color: var(--maincolor); content: '##### '; } +h6::before { color: var(--maincolor); content: '###### '; } + +/* Footer */ +footer { + margin-top: 1em; +} + +/* Common */ +.title h1 { + margin-bottom: 0; +} + +time { + color: grey; +} + +/* Posts */ +article .title { + margin-bottom: 1em; +} + + +/* Callout */ +.callout { + background-color: var(--callouctcolor); + color: #fff; + padding: 1em; +} + +.callout p { + font-family: 'IBM Plex Mono', monospace; + margin: 0; +} + +.callout a { + border-bottom: 3px solid #fff; +} + +.callout a:hover { + background-color: #fff; + color: var(--callouctcolor); +} + +.site-description { +display: flex; +justify-content: space-between; +} +.tags li::before{ + content: "🏷 "; +} +.tags a{ + border-bottom: 3px solid var(--maincolor); +} +.tags a:hover{ + color:white; + background-color: var(--hovercolor); +} +svg{ + max-height: 15px; +} +.soc:hover{ + color: white; +} +.draft-label{ + color: var(--bordercl); + text-decoration: none; + padding: 2px 4px; + border-radius: 4px; + margin-left: 6px; + background-color: #f9f2f4; +} +.highlight { + position: relative; + -webkit-overflow-scrolling: touch; +} +.highlight pre code[class*="language-"] { + -webkit-overflow-scrolling: touch; +} +.highlight pre code[class*="language-"]::before { + background: black; + border-radius: 0 0 0.25rem 0.25rem; + color: white; + font-size: 12px; + letter-spacing: 0.025rem; + padding: 0.1rem 0.5rem; + position: absolute; + right: 1rem; + text-align: right; + text-transform: uppercase; + top: 0; +} + +.highlight pre code[class=language-javaScript]::before, +.highlight pre code[class="language-js"]::before { +content: "js"; +background: #f7df1e; +color: black; +} +.highlight pre code[class*='language-yml']::before, +.highlight pre code[class*='language-yaml']::before { +content: 'yaml'; +background: #f71e6a; +color: white; +} +.highlight pre code[class*='language-shell']::before, +.highlight pre code[class*='language-bash']::before, +.highlight pre code[class*='language-sh']::before { +content: 'shell'; +background: green; +color:white +} +.highlight pre code[class*='language-json']::before{ +content: 'json'; +background: dodgerblue; + color: #000000 +} +.highlight pre code[class*='language-python']::before, +.highlight pre code[class*='language-py']::before { +content: 'py'; +background: blue; +color: yellow ; +} +.highlight pre code[class*='language-css']::before{ +content: 'css'; +background: cyan; +color: black ; +} +.highlight pre code[class*='language-go']::before{ +content: 'Go'; +background: cyan; +color: royalblue ; +} +.highlight pre code[class*='language-md']::before, +.highlight pre code[class*='language-md']::before{ +content: 'Markdown'; +background: royalblue; +color: whitesmoke ; +} diff --git a/themes/archie/static/fonts/fira-sans-v10-latin-regular.eot b/themes/archie/static/fonts/fira-sans-v10-latin-regular.eot new file mode 100644 index 0000000..7abf4c2 Binary files /dev/null and b/themes/archie/static/fonts/fira-sans-v10-latin-regular.eot differ diff --git a/themes/archie/static/fonts/fira-sans-v10-latin-regular.svg b/themes/archie/static/fonts/fira-sans-v10-latin-regular.svg new file mode 100644 index 0000000..1e52097 --- /dev/null +++ b/themes/archie/static/fonts/fira-sans-v10-latin-regular.svg @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/archie/static/fonts/fira-sans-v10-latin-regular.ttf b/themes/archie/static/fonts/fira-sans-v10-latin-regular.ttf new file mode 100644 index 0000000..572e442 Binary files /dev/null and b/themes/archie/static/fonts/fira-sans-v10-latin-regular.ttf differ diff --git a/themes/archie/static/fonts/fira-sans-v10-latin-regular.woff b/themes/archie/static/fonts/fira-sans-v10-latin-regular.woff new file mode 100644 index 0000000..d99ba57 Binary files /dev/null and b/themes/archie/static/fonts/fira-sans-v10-latin-regular.woff differ diff --git a/themes/archie/static/fonts/fira-sans-v10-latin-regular.woff2 b/themes/archie/static/fonts/fira-sans-v10-latin-regular.woff2 new file mode 100644 index 0000000..9bb5760 Binary files /dev/null and b/themes/archie/static/fonts/fira-sans-v10-latin-regular.woff2 differ diff --git a/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.eot b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.eot new file mode 100644 index 0000000..62b89b3 Binary files /dev/null and b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.eot differ diff --git a/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.svg b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.svg new file mode 100644 index 0000000..6423805 --- /dev/null +++ b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.svg @@ -0,0 +1,365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.ttf b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.ttf new file mode 100644 index 0000000..e4d1ddf Binary files /dev/null and b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.ttf differ diff --git a/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff new file mode 100644 index 0000000..4504b41 Binary files /dev/null and b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff differ diff --git a/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff2 b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff2 new file mode 100644 index 0000000..489745d Binary files /dev/null and b/themes/archie/static/fonts/ibm-plex-mono-v6-latin-500italic.woff2 differ diff --git a/themes/archie/static/fonts/roboto-mono-v12-latin-regular.eot b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.eot new file mode 100644 index 0000000..8c56483 Binary files /dev/null and b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.eot differ diff --git a/themes/archie/static/fonts/roboto-mono-v12-latin-regular.svg b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.svg new file mode 100644 index 0000000..1864328 --- /dev/null +++ b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.svg @@ -0,0 +1,405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/archie/static/fonts/roboto-mono-v12-latin-regular.ttf b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.ttf new file mode 100644 index 0000000..d5dee83 Binary files /dev/null and b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.ttf differ diff --git a/themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff new file mode 100644 index 0000000..f319fbf Binary files /dev/null and b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff differ diff --git a/themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff2 b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff2 new file mode 100644 index 0000000..ed384d2 Binary files /dev/null and b/themes/archie/static/fonts/roboto-mono-v12-latin-regular.woff2 differ diff --git a/themes/archie/static/js/feather.min.js b/themes/archie/static/js/feather.min.js new file mode 100644 index 0000000..d229492 --- /dev/null +++ b/themes/archie/static/js/feather.min.js @@ -0,0 +1,13 @@ +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.feather=n():e.feather=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function i(l){if(n[l])return n[l].exports;var t=n[l]={i:l,l:!1,exports:{}};return e[l].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=e,i.c=n,i.d=function(e,n,l){i.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,"a",n),n},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.p="",i(i.s=61)}([function(e,n,i){var l=i(20)("wks"),t=i(11),r=i(1).Symbol,o="function"==typeof r;(e.exports=function(e){return l[e]||(l[e]=o&&r[e]||(o?r:t)("Symbol."+e))}).store=l},function(e,n){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(e,n){var i=e.exports={version:"2.5.6"};"number"==typeof __e&&(__e=i)},function(e,n){var i={}.hasOwnProperty;e.exports=function(e,n){return i.call(e,n)}},function(e,n,i){e.exports=!i(27)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,n,i){var l=i(13);e.exports=function(e){if(!l(e))throw TypeError(e+" is not an object!");return e}},function(e,n,i){var l=i(5),t=i(56),r=i(55),o=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(e,n,i){if(l(e),n=r(n,!0),l(i),t)try{return o(e,n,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[n]=i.value),e}},function(e,n,i){var l=i(6),t=i(12);e.exports=i(4)?function(e,n,i){return l.f(e,n,t(1,i))}:function(e,n,i){return e[n]=i,e}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var l=o(i(35)),t=o(i(33)),r=o(i(32));function o(e){return e&&e.__esModule?e:{default:e}}n.default=Object.keys(t.default).map(function(e){return new l.default(e,t.default[e],r.default[e])}).reduce(function(e,n){return e[n.name]=n,e},{})},function(e,n,i){var l=i(20)("keys"),t=i(11);e.exports=function(e){return l[e]||(l[e]=t(e))}},function(e,n){e.exports={}},function(e,n){var i=0,l=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+l).toString(36))}},function(e,n){e.exports=function(e,n){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:n}}},function(e,n){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,n){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,n){var i=Math.ceil,l=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?l:i)(e)}},function(e,n,i){var l; +/*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +!function(){"use strict";var i=function(){function e(){}function n(e,n){for(var i=n.length,l=0;l0?t(l(e),9007199254740991):0}},function(e,n){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,n,i){var l=i(48),t=i(14);e.exports=function(e){return l(t(e))}},function(e,n,i){var l=i(54);e.exports=function(e,n,i){if(l(e),void 0===n)return e;switch(i){case 1:return function(i){return e.call(n,i)};case 2:return function(i,l){return e.call(n,i,l)};case 3:return function(i,l,t){return e.call(n,i,l,t)}}return function(){return e.apply(n,arguments)}}},function(e,n,i){var l=i(1),t=i(7),r=i(3),o=i(11)("src"),a=Function.toString,c=(""+a).split("toString");i(2).inspectSource=function(e){return a.call(e)},(e.exports=function(e,n,i,a){var y="function"==typeof i;y&&(r(i,"name")||t(i,"name",n)),e[n]!==i&&(y&&(r(i,o)||t(i,o,e[n]?""+e[n]:c.join(String(n)))),e===l?e[n]=i:a?e[n]?e[n]=i:t(e,n,i):(delete e[n],t(e,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||a.call(this)})},function(e,n,i){var l=i(13),t=i(1).document,r=l(t)&&l(t.createElement);e.exports=function(e){return r?t.createElement(e):{}}},function(e,n){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,n,i){var l=i(1),t=i(2),r=i(7),o=i(25),a=i(24),c=function(e,n,i){var y,p,h,x,s=e&c.F,u=e&c.G,d=e&c.S,f=e&c.P,v=e&c.B,g=u?l:d?l[n]||(l[n]={}):(l[n]||{}).prototype,m=u?t:t[n]||(t[n]={}),M=m.prototype||(m.prototype={});for(y in u&&(i=n),i)h=((p=!s&&g&&void 0!==g[y])?g:i)[y],x=v&&p?a(h,l):f&&"function"==typeof h?a(Function.call,h):h,g&&o(g,y,h,e&c.U),m[y]!=h&&r(m,y,x),f&&M[y]!=h&&(M[y]=h)};l.core=t,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,n){e.exports=!1},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var l=Object.assign||function(e){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{};if("undefined"==typeof document)throw new Error("`feather.replace()` only works in a browser environment.");var n=document.querySelectorAll("[data-feather]");Array.from(n).forEach(function(n){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(e){return Array.from(e.attributes).reduce(function(e,n){return e[n.name]=n.value,e},{})}(e),o=i["data-feather"];delete i["data-feather"];var a=r.default[o].toSvg(l({},n,i,{class:(0,t.default)(n.class,i.class)})),c=(new DOMParser).parseFromString(a,"image/svg+xml").querySelector("svg");e.parentNode.replaceChild(c,e)}(n,e)})}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var l,t=i(8),r=(l=t)&&l.__esModule?l:{default:l};n.default=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!e)throw new Error("The required `key` (icon name) parameter is missing.");if(!r.default[e])throw new Error("No icon matching '"+e+"'. See the complete list of icons at https://feathericons.com");return r.default[e].toSvg(n)}},function(e){e.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning"],"alert-octagon":["warning"],"alert-triangle":["warning"],"at-sign":["mention"],award:["achievement","badge"],aperture:["camera","photo"],bell:["alarm","notification"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read"],book:["read","dictionary","booklet","magazine"],bookmark:["read","clip","marker","tag"],briefcase:["work","bag","baggage","folder"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],command:["keyboard","cmd"],compass:["navigation","safari","travel"],copy:["clone","duplicate"],"corner-down-left":["arrow"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch"],"external-link":["outbound"],facebook:["logo"],"fast-forward":["music"],figma:["logo","design","tool"],film:["movie","video"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],global:["world","browser","language","translate"],"hard-drive":["computer","server"],hash:["hashtag","number","pound"],headphones:["music","audio"],heart:["like","love"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication"],"life-bouy":["help","life ring","support"],linkedin:["logo"],lock:["security","password"],"log-in":["sign in","arrow"],"log-out":["sign out","arrow"],mail:["email"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record"],mic:["record"],minimize:["exit fullscreen"],"minimize-2":["exit fullscreen","arrows"],monitor:["tv"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","stop"],"pen-tool":["vector","drawing"],play:["music","start"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],radio:["signal"],rewind:["music"],rss:["feed","subscribe"],save:["floppy disk"],search:["find","magnifier","magnifying glass"],send:["message","mail","paper airplane"],settings:["cog","edit","gear","preferences"],shield:["security"],"shield-off":["security"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slash:["ban","no"],sliders:["settings","controls"],smile:["emoji","face","happy","good","emotion"],speaker:["music"],star:["bookmark","favorite","like"],sun:["brightness","weather","light"],sunrise:["weather"],sunset:["weather"],tag:["label"],target:["bullseye"],terminal:["code","command line"],"thumbs-down":["dislike","bad"],"thumbs-up":["like","good"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],trash:["garbage","delete","remove"],"trash-2":["garbage","delete","remove"],triangle:["delta"],truck:["delivery","van","shipping"],twitter:["logo"],umbrella:["rain","weather"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times"],"x-octagon":["delete","stop","alert","warning","times"],"x-square":["cancel","close","delete","remove","times"],x:["cancel","close","delete","remove","times"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"]}},function(e){e.exports={activity:'',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"dollar-sign":'',"download-cloud":'',download:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},function(e){e.exports={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var l=Object.assign||function(e){for(var n=1;n2&&void 0!==arguments[2]?arguments[2]:[];!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=n,this.contents=i,this.tags=t,this.attrs=l({},o.default,{class:"feather feather-"+n})}return t(e,[{key:"toSvg",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return""+this.contents+""}},{key:"toString",value:function(){return this.contents}}]),e}();n.default=c},function(e,n,i){"use strict";var l=o(i(8)),t=o(i(31)),r=o(i(30));function o(e){return e&&e.__esModule?e:{default:e}}e.exports={icons:l.default,toSvg:t.default,replace:r.default}},function(e,n,i){var l=i(0)("iterator"),t=!1;try{var r=[7][l]();r.return=function(){t=!0},Array.from(r,function(){throw 2})}catch(e){}e.exports=function(e,n){if(!n&&!t)return!1;var i=!1;try{var r=[7],o=r[l]();o.next=function(){return{done:i=!0}},r[l]=function(){return o},e(r)}catch(e){}return i}},function(e,n,i){var l=i(22),t=i(0)("toStringTag"),r="Arguments"==l(function(){return arguments}());e.exports=function(e){var n,i,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,n){try{return e[n]}catch(e){}}(n=Object(e),t))?i:r?l(n):"Object"==(o=l(n))&&"function"==typeof n.callee?"Arguments":o}},function(e,n,i){var l=i(38),t=i(0)("iterator"),r=i(10);e.exports=i(2).getIteratorMethod=function(e){if(void 0!=e)return e[t]||e["@@iterator"]||r[l(e)]}},function(e,n,i){"use strict";var l=i(6),t=i(12);e.exports=function(e,n,i){n in e?l.f(e,n,t(0,i)):e[n]=i}},function(e,n,i){var l=i(10),t=i(0)("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(l.Array===e||r[t]===e)}},function(e,n,i){var l=i(5);e.exports=function(e,n,i,t){try{return t?n(l(i)[0],i[1]):n(i)}catch(n){var r=e.return;throw void 0!==r&&l(r.call(e)),n}}},function(e,n,i){"use strict";var l=i(24),t=i(28),r=i(17),o=i(42),a=i(41),c=i(21),y=i(40),p=i(39);t(t.S+t.F*!i(37)(function(e){Array.from(e)}),"Array",{from:function(e){var n,i,t,h,x=r(e),s="function"==typeof this?this:Array,u=arguments.length,d=u>1?arguments[1]:void 0,f=void 0!==d,v=0,g=p(x);if(f&&(d=l(d,u>2?arguments[2]:void 0,2)),void 0==g||s==Array&&a(g))for(i=new s(n=c(x.length));n>v;v++)y(i,v,f?d(x[v],v):x[v]);else for(h=g.call(x),i=new s;!(t=h.next()).done;v++)y(i,v,f?o(h,d,[t.value,v],!0):t.value);return i.length=v,i}})},function(e,n,i){var l=i(3),t=i(17),r=i(9)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=t(e),l(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,n,i){var l=i(1).document;e.exports=l&&l.documentElement},function(e,n,i){var l=i(15),t=Math.max,r=Math.min;e.exports=function(e,n){return(e=l(e))<0?t(e+n,0):r(e,n)}},function(e,n,i){var l=i(23),t=i(21),r=i(46);e.exports=function(e){return function(n,i,o){var a,c=l(n),y=t(c.length),p=r(o,y);if(e&&i!=i){for(;y>p;)if((a=c[p++])!=a)return!0}else for(;y>p;p++)if((e||p in c)&&c[p]===i)return e||p||0;return!e&&-1}}},function(e,n,i){var l=i(22);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==l(e)?e.split(""):Object(e)}},function(e,n,i){var l=i(3),t=i(23),r=i(47)(!1),o=i(9)("IE_PROTO");e.exports=function(e,n){var i,a=t(e),c=0,y=[];for(i in a)i!=o&&l(a,i)&&y.push(i);for(;n.length>c;)l(a,i=n[c++])&&(~r(y,i)||y.push(i));return y}},function(e,n,i){var l=i(49),t=i(19);e.exports=Object.keys||function(e){return l(e,t)}},function(e,n,i){var l=i(6),t=i(5),r=i(50);e.exports=i(4)?Object.defineProperties:function(e,n){t(e);for(var i,o=r(n),a=o.length,c=0;a>c;)l.f(e,i=o[c++],n[i]);return e}},function(e,n,i){var l=i(5),t=i(51),r=i(19),o=i(9)("IE_PROTO"),a=function(){},c=function(){var e,n=i(26)("iframe"),l=r.length;for(n.style.display="none",i(45).appendChild(n),n.src="javascript:",(e=n.contentWindow.document).open(),e.write("