Skip to content

Instantly share code, notes, and snippets.

View vs9390's full-sized avatar

Vishal Sharma vs9390

View GitHub Profile
@vs9390
vs9390 / facede.go
Last active September 6, 2023 09:24
Facade Design Pattern Example in GO Lang
package main
import "fmt"
var db = map[string]string{
"a@a.com": "a",
"b@b.com": "b",
"xxxxx@gmail.com": "xxxxx sharma",
}
type database struct {
@vs9390
vs9390 / Facade.py
Last active April 27, 2019 06:51
Facade design pattern Example
"""import on the first class #WeatherProvide """
import urllib
import urllib2
"""import on the second class #Parser"""
from datetime import datetime
import json
"""import on the third class #Cache"""
from datetime import timedelta
@vs9390
vs9390 / hotel.sql
Created April 19, 2019 04:17
Hotel db schema
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 19, 2016 at 01:28 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use App\Entity\Fortune;
# frozen_string_literal: true
class HelloWorldController < ApplicationController
def plaintext
render plain: 'Hello, World!'
end
def json
render json: { message: 'Hello, World!' }
end
<?php
namespace App\Http\Controllers;
use App\Models\Fortune;
use App\Models\World;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController {
package main
import (
"github.com/syndtr/goleveldb/leveldb"
"fmt"
"encoding/binary"
"github.com/ethereum/go-ethereum/core/types"
"bytes"
"github.com/ethereum/go-ethereum/rlp"
)
import java.io.*;
class DemoWriteFile {
public static void main(String args[]) {
FileOutputStream fos = null;
BufferedReader br = null;
String str;
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main() {