Skip to content

Instantly share code, notes, and snippets.

View geekyarthurs's full-sized avatar

Mahesh C. Regmi geekyarthurs

View GitHub Profile
import json
import logging
import azure.functions as func
from azure.servicebus import ServiceBusClient, ServiceBusMessage
CONN_STR = "#"
QUEUE_NAME = "messages"
import logging
import json
import azure.functions as func
from twilio.rest import Client
def main(msg: func.ServiceBusMessage):
#/bin/env python
from typing import Callable
def decorator(function: Callable):
def inner_function(*args, **kwargs):
newKwargs = {}
for argName, typeName in function.__annotations__.items():
if typeName is int:
from typing import Callable
def decorator(func: Callable):
def inner_func(*args, **kwargs):
print(kwargs, func.__annotations__)
func(*args, **kwargs)
return inner_func
def getAge(age: int, name: str):
print( f" {age} : {type(age)} , {name} : {type(name)} " )
def getAge(age, name):
print( f" {age} : {type(age)} , {name} : {type(name)} " )
def someRandomView(slug):
...
def someRandomProfile(pk):
...
urlpatterns = [
path("/<str:slug>", someRandomView, name="home"),
path("/<int:pk>", someRandomProfile, name="home_profile")
]
@geekyarthurs
geekyarthurs / useUserReducer.ts
Created November 2, 2020 16:32 — forked from schettino/useUserReducer.ts
Better Reducers with React and Typescript 3.4
import { useReducer } from 'react'
export function updateName(name: string) {
return <const>{
type: 'UPDATE_NAME',
name
}
}
export function addPoints(points: number) {
#include <stdio.h>
void developer(char *flagString, int length){
flagString[1] = '\0';
}