Skip to content

Instantly share code, notes, and snippets.

View tandevmode's full-sized avatar

Warit Wanwithu tandevmode

View GitHub Profile
@tandevmode
tandevmode / app.py
Created June 6, 2018 03:33
Back-end of paint something
from flask import Flask, request, render_template, make_response
from flask_bootstrap import Bootstrap
import os
import uuid
import base64
from PIL import Image
import warnings
warnings.simplefilter('error', Image.DecompressionBombWarning)
@tandevmode
tandevmode / index.html
Last active February 12, 2019 17:07
Prepare Canvas
<script src="https://d.line-scdn.net/liff/1.0/sdk.js" /></script>
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js"></script>
<script>
const canvas = document.querySelector('#canvas');
const signaturePad = new SignaturePad(canvas, {
backgroundColor: 'rgb(238,238,238)',
});
$(window).on('load', function(){
canvas.setAttribute('width', $('.container').width());
@tandevmode
tandevmode / liff.js
Created June 6, 2018 03:12
เรียกใช้ LIFF API
liff.getProfile().then(function (profile) {
liff.sendMessages([
{
type: 'image',
originalContentUrl: 'https://' + document.domain + '/imgs/' + res + '.jpg',
previewImageUrl: 'https://' + document.domain + '/imgs/' + res + '_240.jpg'
},
{
type: 'text',
text: 'From:' + profile.displayName