Skip to content

Instantly share code, notes, and snippets.

View DarkcoderSe's full-sized avatar
:octocat:
Focusing

Kashif S. DarkcoderSe

:octocat:
Focusing
View GitHub Profile
<?php
$passengerCount = 51;
function calculateVehicles($passengers) : void {
echo ceil($passengers / 5);
}
calculateVehicles($passengerCount);
<?php
$arrayOfObjects = [
[
'id' => 10,
'name' => 'John',
'age' => 20
],
[
'id' => 2,
@DarkcoderSe
DarkcoderSe / chat_example_django.py
Last active June 8, 2023 10:45
Django Channels Chat Exmaple with DB.
# routing.py file
# room_name is consist of conversation.id where sender and receiver is saved
path(r"ws/chat/<str:room_name>", consumers.ChatConsumer.as_asgi()),
# consumers.py file
class ChatConsumer(WebsocketConsumer):
def connect(self):
print("here")
[
{
"label": "🤐 Rather not to say",
"value": "Rather not to say",
"active": true
},
{
"label": "🤷‍♂️ Other",
"value": "Other"
},