The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
var element = document.querySelector('.droppable'); | |
var droppedFiles = []; | |
function callback(files) { | |
for(var i=0; i<files.length; i++) { | |
droppedFiles.push(files[i]); | |
} | |
} | |
makeDroppable(element, callback); | |
var uploadBtn = document.querySelector('.upload-btn'); |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route("/", methods=['GET', 'POST']) | |
def upload(): | |
if request.method == 'GET': | |
return """ | |
<form enctype="multipart/form-data" method="POST"> |
import os | |
import json | |
import datetime | |
from flask import Flask, url_for, redirect, \ | |
render_template, session, request | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext.login import LoginManager, login_required, login_user, \ | |
logout_user, current_user, UserMixin | |
from requests_oauthlib import OAuth2Session |
<iframe src="https://www.youtube.com/embed/M9AfkPhL5G4?autoplay=1&autohide=1&border=0&wmode=opaque&hl=en&cc_lang_pref=en&enablejsapi=1&feature=gp-o-o&authuser=0" scrolling="auto" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="border: none; margin: 0px; vertical-align: bottom; width: 346px; height: 230px;" id="widget2"></iframe> |
import uuid | |
import wtforms_json | |
from sqlalchemy import not_ | |
from sqlalchemy.dialects.postgresql import UUID | |
from wtforms import Form | |
from wtforms.fields import FormField, FieldList | |
from wtforms.validators import Length | |
from flask import current_app as app | |
from flask import request, json, jsonify, abort |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
char *op; | |
void revStr(char *ip){ | |
int ln = strlen(ip); | |
op = malloc(sizeof(char)*(ln+1)); | |
int i,j,u,l; |
var nextBtn, prevBtn, images; // for storing references to next button, previous button and the images | |
var currentImage = 0; // the index of image that is to be shown initially | |
var totalImages; | |
function init() { | |
// body... | |
nextBtn = document.getElementById('nextBtn'); // get reference to next button | |
prevBtn = document.getElementById('prevBtn'); // get reference to previous button | |
images = document.getElementsByClassName('image'); // get reference to all the images | |
totalImages = images.length; // store the count of total number of images in the slide show |
#include <iostream> | |
#include <iomanip> | |
using namespace std; | |
struct Employee{ | |
string id,fname,lname; | |
double salary; | |
}; |