Rewrite SQL Queries in Pandas
From time to time, I have done various tasks in SQL and Python. However, Pandas’ syntax is quite different from SQL. With SQL, you declare what you want in a sentence that almost reads like English. In Pandas, you apply operations on the dataset, and chain them, in order to transform and reshape the data the way you want it.
Python’s Requests Library Notes
The requests library is the de facto standard for making HTTP requests in Python. It abstracts the complexities of making requests behind a beautiful, simple API so that you can focus on interacting with services and consuming data in your application.
Using data attributes in HTML5
HTML5 is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning. data-*attributes allow us to store extra information on standard, semantic HTML elements without other hacks such as non-standard attributes, extra properties on DOM, or
If you are kooking for a site's URL information, then the window.location object is for you! Use its properties to get information on the current page address or use its methods to do some page redirect or refresh.
HiveSQL Tricks for A Better Life
This post is mainly a notebook I use to record some practical HiveSQL tricks during daily work. Hopefully it will also make your life easier.
Fetch Data from PostgreSQL Databases in Python
We use pandas and
psycopg2 together to connect with PostgreSQL.
psycopg2 is a package allows us to create a connection with PostgreSQL databases in Python, and we will use
pandas to interact with the database.
Schedule a Cron job
crontab is often used in Linux systems to perform automation jobs.
Deploy Dash on Server by Gunicorn
Dash is an open-sourced Python Dashboard package from plot.ly. It's pretty easy to use and has a lot of components to build beautiful and informative graphs and charts.
Set Up a Local File Sharing Server on Raspberry Pi 4 B
The latest Raspberry Pi 4B comes with a Gigabit ethernet port, up to 4GB RAM and 2 USB3 port. Because of its low power supply, Raspberry Pi 4 surely has the capability of working as an affordable file server to back up and share files from anywhere on your local network. In other words, all your local devices not only can backup your important files to the Raspberry Pi, but also plays movies stored in the Raspberry Pi. You can even plug external drives to it to enlarge the disk space. In this tutorial, we will use Samba to set up a file server on your Raspberry Pi 4.
Move a Ghost Site Across Servers
From time to time you might want to migrate your website to a different server/VPS provider. This tutorial highlights some steps you should be very careful about. Improper operation may result in loss of data or files of the website.