Python
https://realpython.com/python-virtual-environments-a-primer/
Mac
Sudo easy_install pip
Python
https://realpython.com/python-virtual-environments-a-primer/
Mac
Sudo easy_install pip
<section class="posts wrapper"> | |
<article class="post post featured"> | |
<header> | |
<div class="feature"><span>Featured</span><i class="fa fa-bookmark fa-lg"></i></div> | |
<h2></h2> | |
<h1 id="posttitle"><a href="#">How to configure your AngularJS application using environment variables</a></h1> | |
<span> | |
Posted by <a href="https://twitter.com/jvandemo" target="_blank">Jurgen Van de Moere</a> | |
on <i class="fa fa-clock-o"></i> <time datetime="2016-02-24">February 24th, 2016</time>. | |
</span> |
# example folder structure | |
# images | |
# ---- Tigers | |
# -------------1_tigers.jpg | |
# -------------2_tigers.jpg | |
# -------------2_tigers.png | |
# -------------n_tigers.jpg | |
# ---- Cats | |
# -------------1_cats.jpg | |
# -------------2_tcats.jpg |
import PIL | |
from PIL import Image | |
import os | |
import sys | |
def readf(): | |
try: | |
input_dir = str(sys.argv[1].rstrip('/')) #path to img source folder | |
img_size = str(sys.argv[2]) #The image size (128, 256,etc) | |
output_dir = str(sys.argv[3].rstrip('/')) #output directory | |
print "starting...." |
<!-- | |
Preprocessing (scaling down) images on client side before uploading | |
Because people often upload 5MB big 3000x2000px PNGs that are then scaled down to 100x100px JPEGs on server - waste of time and bandwidth | |
1. user selects image(s) | |
2. script opens the image using FileReader API | |
3. script appends it to new Image object (not displayed at all actually) | |
4. new Image objects is drawn into new Canvas object, that is scaled down to desired dimensions | |
5. display the canvas, ie. a preview of the image to be uploaded |
var a = 1; | |
let b = 2; | |
var c = "hello"; | |
var d = "a"; | |
d = 5; | |
d = 5.6; | |
var f = 5 + a; | |
console.log('f=',f); |
How to install Xdebug on MacOS 10.15 Catalina (Xcode 11) When you try to build xdebug on macOS Catalina you will get errors like these:
phpize grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version:
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Form validation: Task 1</title> | |
<style> | |
body { | |
background-color: #fff; | |
color: #333; | |
font: 1em / 1.4 Helvetica Neue, Helvetica, Arial, sans-serif; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Form validation: Task 2</title> | |
<style> | |
body { | |
background-color: #fff; | |
color: #333; | |
font: 1em / 1.4 Helvetica Neue, Helvetica, Arial, sans-serif; |