Skip to content

Instantly share code, notes, and snippets.

View rajubd49's full-sized avatar

Md Harish Uz Jaman Mridha rajubd49

View GitHub Profile
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
final class Loader: BindableObject {
let didChange = PassthroughSubject<Data?, Never>()
var task: URLSessionDataTask!
var data: Data? = nil {
didSet {
didChange.send(data)
}
}
init(_ url: URL) {
@NHuyHoang
NHuyHoang / Handle BottomNavigationBar
Last active November 9, 2022 12:01
Programmatically select BottomNavigationBar Tab in Flutter instead of built in onTap callback
class _BTMAppBarState extends State<BTMAppBar> {
int navigationIndex = 0;
GlobalKey globalKey = new GlobalKey(debugLabel: 'btm_app_bar');
@override
Widget build(BuildContext context) {
return new Scaffold(
bottomNavigationBar: new BottomNavigationBar(
key: globalKey,
items: [
@hcn1519
hcn1519 / GradientLayer.md
Last active June 7, 2023 09:33
UITableViewCell with GradientLayer in swift

Create GradientLayer on your tableViewCell(collectionViewCell)

1. Create CAGradientLayer Instance on your tableViewCell

class MyCell: UITableViewCell {
    let gradientLayer = CAGradientLayer()
}
@codediodeio
codediodeio / database.rules.json
Last active January 28, 2024 19:07
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@gbitaudeau
gbitaudeau / LayoutableButton.swift
Last active April 2, 2021 08:38
I created a UIButton subclass whose purpose is to be able to choose where the button's image is layout, either vertically or horizontally. See http://stackoverflow.com/a/41744464/1661338
// Created by Guillaume BITAUDEAU on 19/01/2017.
// @see : http://stackoverflow.com/a/41744464/1661338
import UIKit
@IBDesignable
class LayoutableButton: UIButton {
enum VerticalAlignment : String {
@rbrahul
rbrahul / LinkedInEndoresmentScript.js
Last active March 30, 2018 20:19
Run this script in your browser console while visiting profile page of any linked user then it will automatically endorse skills :)
var endorsPlusButtons = document.querySelectorAll(".endorsable");
var index = 0;
if (endorsPlusButtons.length) {
var interval = setInterval(() => {
if (index < (endorsPlusButtons.length)) {
setTimeout((indx) => {
endorsPlusButtons[indx].querySelector(".endorse-plus").click();
}, parseInt(Math.random() * 11) * 400, index);
} else {
@nor0x
nor0x / shadow+cornerradius.swift
Created December 22, 2016 17:23
UICollectionViewCell -> Corner Radius AND Shadow
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
cell.contentView.layer.cornerRadius = 2.0
cell.contentView.layer.borderWidth = 1.0
cell.contentView.layer.borderColor = UIColor.clear.cgColor
cell.contentView.layer.masksToBounds = true;
cell.layer.shadowColor = UIColor.lightGray.cgColor
cell.layer.shadowOffset = CGSize(width:0,height: 2.0)
cell.layer.shadowRadius = 2.0
cell.layer.shadowOpacity = 1.0
@barbietunnie
barbietunnie / modal-view.md
Last active November 3, 2022 10:04
Swift Modal View Controller with transparent background

You can do it like this:

In your main view controller:

func showModal() {
    let modalViewController = ModalViewController()
    modalViewController.modalPresentationStyle = .OverCurrentContext
    presentViewController(modalViewController, animated: true, completion: nil)
}
//*****************************************************************************//
// Universal Converter
//*****************************************************************************//
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
#include<string.h>