Tools, Codes and How To
A collection of tools, codes, tips and hints, I want to share.
git
Start Git Repository
Assuming git is installed and within PATH. If not, install Git
- Create repository
git init - Create .gitignore file to git repository root directory
- Add all new files to repository
git add . - Commit changes
git commit -am "some unique commit comments"
gae
Command Line Deploy App
The command line statement below creates a new version of the app which then can be tested before replacing the version in production. replace [appid] with the corresponding app id. Execute from the local main app folder
sudo gcloud app deploy --project [appid] --no-promote
gae, python
Run App Locally
Within the main folder of the app. First, switch env and install libraries.
- virtualenv -p python3 env
- source env/bin/activate
- pip install -r requirements.txt
Finally run app
- python main.py
mac
Edit Hosts File on Mac
- Use terminal/nano to edit the file [⌘ <Spacebar>] terminal
- sudo nano /private/etc/hosts
- sudo dscacheutil -flushcache
design
Website Design
Tired to look up these urls, used frequently while building web pages:
design, css
Round Button
Height, width, line-height with border-radius 50% are the important properties. These values have to be adjusted manually. If the text spans multiple lines, change line-height to 1rem, use padding-top to place start of the text and adjust height to recover the circle.
Get Hash for CSS/JS
More about you ;)
{'path': '/tools/', 'query': b'', 'referrer': None} - {'city': 'ashburn', 'region': 'va', 'country': 'US', 'latlang': '39.043757,-77.487442', 'ip': '54.236.58.220, 169.254.1.1', 'agent': 'CCBot/2.0 (https://commoncrawl.org/faq/)', 'uuid': None}