Skip to content

Instantly share code, notes, and snippets.

View MohammadaliMirhamed's full-sized avatar
🤓
Code never lies, but comments do

MohammadAli MohammadaliMirhamed

🤓
Code never lies, but comments do
View GitHub Profile
import CredentialsProvider from "next-auth/providers/credentials";
import { NuxtAuthHandler } from "#auth";
export default NuxtAuthHandler({
secret: useRuntimeConfig().authSecret,
providers: [
CredentialsProvider.default({
name: "Credentials",
async authorize(credentials: any) {
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Created September 12, 2019 05:25 — forked from rhafiko/PhpFireBaseNotificationSample.php
forked from MohammadaliMirhamed/PhpFireBaseNotificationSample.php -Simple PHP FireBase (FCM) script showing how to send an Android push notification. -Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. -Create project on firebase console, It returns me Server Accesss key and Legacy key under Projec…
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
$topic = $_GET['topic'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@MohammadaliMirhamed
MohammadaliMirhamed / countrydropdown.html
Created May 26, 2019 08:46 — forked from danrovito/countrydropdown.html
HTML Country Select Dropdown List
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span>
<select id="country" name="country" class="form-control">
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
@MohammadaliMirhamed
MohammadaliMirhamed / test3.py
Created December 9, 2016 20:31
a funny trick for say hello new year 2017 in python
words="#$!F4@#$hF6!a@#D$5p4()*Dp$565Dy-^*n&DeA(*w)-S8y9*e()DFa)(r8-EF@()28#0$3147"
index=0;message=""
while index<len(words):
if words[index] in "<-abcdefghijklmnpqrstuvwxyz2017->":
message+=words[index]
index+=1
print(message)
@MohammadaliMirhamed
MohammadaliMirhamed / test5.py
Created December 9, 2016 20:27
some usefull functions in python for work with string
print "mohammadali".isdigit()
print "123456".isdigit()
print "ABCD".isupper()
print "abcd".islower()
print "".isalnum()
@MohammadaliMirhamed
MohammadaliMirhamed / test7.py
Created December 9, 2016 20:19
Q1= yek adad begire va az 0 ta on adad , adade zoje beyensh ro be sourt list neshon bede Q2=listy ke az tamrin bala besd omadeh ro mojmooesh ro chup kone Q3=added bedast amadeh az tamrin bala tadad arghamsh ra chup konid khoroje Q1 ba farze vorody 10 A1=[0,2,4,6,8] A2=20 A3=2
'''
Q1= yek adad begire va az 0 ta on adad , adade zoje beyensh ro be sourt list neshon bede
Q2=listy ke az tamrin bala besd omadeh ro mojmooesh ro chup kone
Q3=added bedast amadeh az tamrin bala tadad arghamsh ra chup konid
khoroje Q1 ba farze vorody 10
A1=[0,2,4,6,8]
A2=20
A3=2
'''
@MohammadaliMirhamed
MohammadaliMirhamed / test10.py
Created December 9, 2016 20:17
calculate average marks in Python
class average:
def total_marks(self):
self.total_marks_num = input("Enter Total Of Marks : ")
print "=========================================\n"
#-------------------------------------------------------------------
def set_list_of_marks(self):
mark=0;self.marksList=[];counter=0
while counter<self.total_marks_num:
mark=input("Enter Mark #"+str(counter+1)+": ")
self.marksList.append(float(mark))
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active May 28, 2024 11:37
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',