Skip to content

Instantly share code, notes, and snippets.

View shafi2263's full-sized avatar

Shafi Alam shafi2263

  • Apploye Inc.
View GitHub Profile
from django.contrib.auth import get_user_model
from rest_framework_simplejwt.serializers import TokenObtainSerializer
from rest_framework_simplejwt.tokens import RefreshToken
class MyTokenObtainSerializer(TokenObtainSerializer):
@classmethod
def get_token(cls, user):
return RefreshToken.for_user(user)
import time
from itertools import repeat
n = 100000000
array = []
start = time.time()
for i in range(n):
array.append(0)
largest = 0
smallest = 0
while True:
try:
num = input("Enter a number: ")
try:
if num == 'done':
break;
#!/usr/bin/python3
from PIL import Image, ImageDraw, ImageFont
img = Image.new('RGB',(300,200),(255,255,255))
draw = ImageDraw.Draw(img)
text = u"আমি দেখছি অনেক কিছুই"
fontdir = '/usr/share/fonts'
fontfile = ImageFont.truetype("/home/shafi/Downloads/BenSenHandwriting.ttf",24) #use a bengali font of choice
draw.text((50,100), text, fill='blue',font=fontfile)
img.save('imagetext.jpg')
import java.util.Stack;
import java.util.Vector;
public class AdvanceCalculator extends Calculator{
private String temp;
private String mainInputString ;
Vector <Float> vec = new Vector<>();
Vector <content> postFix = new Vector<>();
public class Calculator {
public Calculator () {
}
public int add (int numberOne, int numberTwo){
return (numberOne+numberTwo);
}
public double add (double numberOne , double numberTwo){
import java.util.Scanner;
public class MainApp_2 {
public static void main(String args[]) {
Scanner stdin = new Scanner(System.in);
String input = stdin.nextLine();
@shafi2263
shafi2263 / towerOfHanoi.cpp
Last active August 29, 2015 14:06
A "Tower Of Hanoi" solve for n number of disks so freaking for increasing number of disks
/*
* Md. Shafi Ul Alam
* BSSE- 0630
* Date: 11-09-2014
*/
/*
* The program demonstrates the solution of "Tower Of Hanoi" using the recursion process for N number of disks
*
* pegs denoted by peg-1, peg-2 and peg-3
*
//dfa.cpp dfa = definite finite automata
//user shall define the starting step and finishing step(s). User is given the liberty to define conditions for multiple steps.
//Binary string input determines whether finishing step(s) reached
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main (void)
//greatestSubstring.cpp
//program finds out the greatest substring between two strings
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main (void)