This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/42098126/mac-osx-python-ssl-sslerror-ssl-certificate-verify-failed-certificate-verify | |
Issue with company network: | |
pip install --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org oauthlib -vvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://medium.com/@wkrzywiec/deployment-of-spring-mvc-app-on-a-local-tomcat-server-for-beginners-3dfff9161908 | |
sudo mkdir -p /Library/Tomcat | |
sudo mv ~/Downloads/apache-tomcat-7.0.92.tar.gz /Library/Tomcat/ | |
sudo gunzip apache-tomcat-7.0.92.tar.gz | |
sudo tar -xvf apache-tomcat-7.0.92.tar | |
sudo chmod +x /Library/Tomcat/apache-tomcat-7.0.92/bin/*.sh | |
sudo ./Library/Tomcat/apache-tomcat-7.0/bin/startup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On MAC OS: | |
What to do about: | |
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045) | |
Ref: | |
https://bugs.python.org/issue29480 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku pg:info --app sfly-promoscraper | |
=== DATABASE_URL | |
Plan: Hobby-dev | |
Status: Available | |
Connections: 0/20 | |
PG Version: 10.6 | |
Created: 2019-01-16 22:38 UTC | |
Data Size: 7.6 MB | |
Tables: 0 | |
Rows: 0/10000 (In compliance) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.digitalocean.com/community/tutorials/how-to-build-a-machine-learning-classifier-in-python-with-scikit-learn | |
from sklearn.datasets import load_breast_cancer | |
from sklearn.model_selection import train_test_split | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.metrics import accuracy_score | |
# Load dataset | |
data = load_breast_cancer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to make migrations on models are defined | |
python manage.py makemigrations | |
# review sql for the migration | |
python manage.py sqlmigrate <app_name> <migration_number> | |
e.g. python manage.py sqlmigrate boards 0001 | |
# Django shell to play with the db | |
python manage.py shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create 2 scenes 0.tscn and 1.tscn | |
# Add a Node and call it main | |
# Add script as below to main | |
extends Node | |
var scenes = [0,1] | |
func _ready(): | |
# randomize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ref : https://www.reddit.com/r/godot/comments/7bi5uf/generating_a_scene_tree_dynamically/ | |
# Create a root Node and name is DynamicNodeGraph | |
extends Node | |
var RootNode | |
var SomeGraphEdit | |
var SomePopupMenu | |
var SomePopupMenuVisible = false | |
var RMBPressed = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To get that ParallaxBackground working: | |
1. Create a ParallaxBackground node. (It doesn't need to be a child of the Camera2D node, but making it a child of the Camera2D node won't break it either) | |
2. Create a ParallaxLayer node as a child of the ParallaxBackground. | |
3. Add your sprite as a child of the ParallaxLayer node and make sure Centered is off. | |
4. Go back to the ParallaxLayer node. | |
5. Under Motion, set Mirroring to the size of your sprite (in the case of the Sky sprite, 640x640). | |
6. Under Motion, fiddle with the Scale setting. This is how fast that ParallaxLayer will move in relation to the camera. I found (0.1, 0.1) to be a good starting point for something like a sky. | |
7. Run your game, and you should have a background that infinitely loops and also has a parallax effect. |
NewerOlder