Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
The aim of this gist is to fix the following informative post about uploading via XHR.
The first part is the HTML. First of all, you really don't need JavaScript to upload a file but you do need a proper form. Secondly, inputs in a form shouild have a name, because the name is what the server will receive: not IDs, names!
Following the fixed form part.
from bs4 import BeautifulSoup,SoupStrainer | |
import urllib.request | |
import colorama,re,queue,threading | |
from colorama import Fore | |
from urllib.parse import * | |
class check_link(): | |
def __init__(self,address): | |
self.address=address | |
def check(self,address): |
$("#parsleyForm").parsley({ | |
errorClass: 'has-danger', | |
successClass: 'has-success', | |
classHandler: function(ParsleyField) { | |
return ParsleyField.$element.parents('.form-group'); | |
}, | |
errorsContainer: function(ParsleyField) { | |
return ParsleyField.$element.parents('.form-group'); | |
}, | |
errorsWrapper: '<span class="text-help">', |
<!--When a JSON-LD document's top-level structure is an object that contains no other | |
properties than @graph and optionally @context (properties that are not mapped to an IRI | |
or a keyword are ignored), @graph is considered to express the otherwise implicit default graph. | |
This mechanism can be useful when a number of nodes exist at the document's top level that | |
share the same context, which is, e.g., the case when a document is flattened. The @graph | |
keyword collects such nodes in an array and allows the use of a shared context. | |
From https://www.w3.org/TR/json-ld/#h3_named-graphs | |
More on graph - http://stackoverflow.com/questions/30505796/json-ld-schema-org-multiple-video-image-page/30506476#30506476 |
user nginx; | |
# one(1) worker or equal the number of _real_ cpu cores. 4=4 core cpu | |
worker_processes 4; | |
# renice workers to reduce priority compared to system processes for | |
# machine health. worst case nginx will get ~25% system resources at nice=15 | |
worker_priority -5; |
public void function onError(required any exception, required string eventname){ | |
//log error | |
writeLog(file='[LOG FILE NAME]', text='#arguments.exception.message#'); | |
//save error information in a single variable | |
savecontent variable='errortext' { | |
writeOutput("An error occurred: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br /> | |
Time: #now().dateFormat('short')# :: #now().timeFormat('short')#<br />"); | |
writeDump(var=arguments.exception, label='Error Log'); | |
writeDump(var=form, label='Form Scope'); |
component { | |
boolean function onRequestStart( required string targetPage ) { | |
var headers = getHttpRequestData().headers; | |
var origin = ''; | |
var PC = getpagecontext().getresponse(); | |
// Find the Origin of the request | |
if( structKeyExists( headers, 'Origin' ) ) { |
<!--- 2/16/2016 Exiv2(filePath, ExePath) | |
James Moberg - SunStar Media | |
Requires command-line version of Exiv2 http://www.exiv2.org/ | |
All data returned in a struct. Based on filetype & metadata, keys may not always exist. | |
Latitude/Longitude keys w/decimal values added. All dates formatted to M/D/YYYY HH:MM:SS format. | |
Similar to ImageGetEXIFMetaData(imageNew( imageFilePath )), but much faster. (Exiv2 = 16-47ms; CF = 500-920ms) | |
---> | |
<cffunction name="Exiv2" returntype="struct" output="no"> | |
<cfargument name="filepath" type="string" required="true"> | |
<cfargument name="EXEpath" default="C:\Exiv2\Exiv2.exe" type="string" required="false"> |
<cfset jarsPath = expandPath('/java/barcode4j/') /> | |
<!--- Path where the necessary jar files are located (downloadable from https://www.dropbox.com/s/skl9fwky2n7mnjr/java-files-barcode4j.zip?dl=0) ---> | |
<cfset libraryList = arrayToList( directoryList(jarsPath, false, 'array', '*.jar') ) /> | |
<cfset configBuilder = createObject('java', 'org.apache.avalon.framework.configuration.DefaultConfigurationBuilder', libraryList) /> | |
<cfset barcodeUtil = createObject('java', 'org.krysalis.barcode4j.BarcodeUtil', libraryList) /> | |
<cfset grayImageType = createObject('java', 'java.awt.image.BufferedImage').TYPE_BYTE_GRAY /> | |
<!--- create custom config. See http://barcode4j.sourceforge.net/2.1/symbol-ean-13.html ---> | |
<cfset configXml = '<barcode> |