Skip to content

Instantly share code, notes, and snippets.

View kareemsuhail's full-sized avatar

Kareem Ayesh kareemsuhail

View GitHub Profile
@kareemsuhail
kareemsuhail / careem.py
Created December 10, 2017 12:59
this code is for careem internship
def firstNonRepeatingLetter(word):
for char in word:
if word.lower().count(char.lower()) == 1 :
return char
return ""
# manuel Testing
print(firstNonRepeatingLetter("sTreSS"))
print(firstNonRepeatingLetter("sdasddd"))
print(firstNonRepeatingLetter("wWw"))
// this gist is for eng.adnan about jwt
// first of all use this packge jsonwebtoken
// you can download it simply by typing this in your cmd :
//npm install jsonwebtoken
// ==========================//
// how to create tokens (login)
var user = await User.findOne({email:data.email}).exec(); //get user from database by email
if(user.validatePassword(data.password)){ // check password
var Token = jwt.sign({_id:user._id}, // generate token for and storing user id and expiration period