Skip to content

Instantly share code, notes, and snippets.

View shadmazumder's full-sized avatar
🏠
Working from home

Shad Rayhan Mazumder shadmazumder

🏠
Working from home
View GitHub Profile
@shadmazumder
shadmazumder / backtracking_template.py
Created April 22, 2022 00:23 — forked from RuolinZheng08/backtracking_template.py
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
@shadmazumder
shadmazumder / AsynPlayground.swift
Created August 29, 2018 21:57
Quick way to check response json over a network call on Xcode's Playground
import PlaygroundSupport
import Foundation
let url = URL(string: "https://my-json-server.typicode.com/shadmazumder/demo/db")
let task = URLSession.shared.dataTask(with: url!) { (data, response, error) in
"Response: " + response.debugDescription
@shadmazumder
shadmazumder / PlaygroundURLSession.swift
Last active February 5, 2018 16:41
URLSession on Playground, simple get request.
//: Playground - noun: a place where people can play
import Foundation
struct Service{
static func execute() -> URLSessionDataTask? {
guard let url = URL(string: "https://jsonplaceholder.typicode.com/users/1") else { return nil}