Skip to content

Instantly share code, notes, and snippets.

View brijeshb42's full-sized avatar
🏠
Working from home

Brijesh Bittu brijeshb42

🏠
Working from home
View GitHub Profile
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">
@brijeshb42
brijeshb42 / app.py
Last active September 25, 2020 20:16
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&amp;autohide=1&amp;border=0&amp;wmode=opaque&amp;hl=en&amp;cc_lang_pref=en&amp;enablejsapi=1&amp;feature=gp-o-o&amp;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>
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@brijeshb42
brijeshb42 / api.py
Last active August 29, 2015 14:16 — forked from alanhamlett/api.py
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

Contract Killer

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

@brijeshb42
brijeshb42 / str.c
Created October 20, 2014 13:54
str-rev
#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;
@brijeshb42
brijeshb42 / explanation.js
Last active August 29, 2015 14:02
Photography Question
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;
};