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
const file = this.input.files[0]; | |
//console.log(file); | |
var xhr = new XMLHttpRequest(); | |
xhr.addEventListener('load', (e) => { | |
console.log(e.target.response); | |
}); | |
xhr.open('POST', host + 'fileuploadstream', true); | |
xhr.setRequestHeader('body', JSON.stringify({ id: 'somebucketfolderid', fn: file.name })); | |
xhr.send(file); |
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
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
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
# views.py | |
from myproject.myfunctions import upload_profile_picture | |
def profile_picture(request): | |
# setup (checking for post, checking if the | |
# user is authenticated, etc.) | |
user = request.user | |
pic_file = request.FILES['profile_picture'] | |
result_url = upload_profile_picture(pic_file) |
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
<?php | |
$index = Zend_Search_Lucene::open(your_index_dir); | |
$query = 'some search query'; | |
$result = $index->find($query); | |
$perPage = 20; | |
$page = 5; | |
$range = 4; | |
Zend_Paginator::setDefaultScrollingStyle('Elastic'); |