Skip to content

Instantly share code, notes, and snippets.

View ahmadasjad's full-sized avatar
🛠️
I love making coding easier

AHMAD ASJAD ahmadasjad

🛠️
I love making coding easier
View GitHub Profile
from flask import Flask, request, jsonify
import torch
import os
import logging
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
logger = logging.getLogger()
@ahmadasjad
ahmadasjad / calculator.py
Created October 20, 2018 18:38
Desktop calculator using Python
from tkinter import *
import re
class Calculator(Frame):
def __init__(self, master=None):
master = self.main_window()
super().__init__(master)
self.pack()
self.create_widgets()
jQuery(document).ready(function () {
/*
* Give an attribute to anchor tag 'js-add' and the value of that attribute
* to be his parent selector which is to be copied and to be added after it.
* For example if you provide <a js-add=".js-field_row">text</a>
* On click of this element will copy its parent element having class js-field_row
* and will after it.
* */
jQuery(document).on('click', 'a[js-add]', function () {
var element_to_clone_selector = jQuery(this).attr('js-add');