Skip to content

Instantly share code, notes, and snippets.

View serefercelik's full-sized avatar

Şeref Erçelik serefercelik

View GitHub Profile
@serefercelik
serefercelik / README.md
Created September 13, 2022 11:01 — forked from mpociot/README.md
A Scriptable widget to show the upcoming Laracon talks

Laracon Scriptable Widget

Usage

  1. Install and download the free Scriptable app on your iOS device.
  2. Inside the app, press the "Plus" icon to create a new script
  3. Paste the content of the JS file into the script
  4. Place a Scriptable widget on your home screen
@serefercelik
serefercelik / index.php
Created September 3, 2022 07:48 — forked from edamov/index.php
PHP token-based (JWT) push notifications to APNS via HTTP/2
<?php
require_once 'vendor/autoload.php';
use Jose\Factory\JWKFactory;
use Jose\Factory\JWSFactory;
$key_file = 'key.p8';
$secret = null; // If the key is encrypted, the secret must be set in this variable
$private_key = JWKFactory::createFromKeyFile($key_file, $secret, [
@serefercelik
serefercelik / BnbStaking.sol
Created December 23, 2021 20:26 — forked from SibghatUllah1997/BnbStaking.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=true&runs=200&gist=
pragma solidity 0.6.12;
import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol';
import '@pancakeswap/pancake-swap-lib/contracts/access/Ownable.sol';
// import "@nomiclabs/buidler/console.sol";
interface IWBNB {
@serefercelik
serefercelik / CRWToken.sol
Created June 4, 2021 10:35
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
pragma solidity ^0.4.24;
//Safe Math Interface
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
@serefercelik
serefercelik / 1.SequenceExample.swift
Created September 18, 2020 01:53 — forked from lamprosg/1.SequenceExample.swift
(iOS) Conforming to Sequence & Collection protocols
//A sequence is a list of values that you can step through one at a time.
//The most common way to iterate over the elements of a sequence is to use a for-in loop:
/*
Potentially our database could contain a large set of records,
and for each model we need to hit the disk to actually load its data,
so we don’t want to load everything at once.
To make this happen, we’re going to replace the array return type with our own custom sequence.
*/
//https://www.swiftbysundell.com/articles/swift-sequences-the-art-of-being-lazy/
@serefercelik
serefercelik / UIKitTabView.swift
Created September 11, 2020 20:56 — forked from Amzd/UIKitTabView.swift
UIKitTabView. SwiftUI tab bar view that respects navigation stacks when tabs are switched (unlike the TabView implementation)
/// An iOS style TabView that doesn't reset it's childrens navigation stacks when tabs are switched.
public struct UIKitTabView: View {
private var viewControllers: [UIHostingController<AnyView>]
private var selectedIndex: Binding<Int>?
@State private var fallbackSelectedIndex: Int = 0
public init(selectedIndex: Binding<Int>? = nil, @TabBuilder _ views: () -> [Tab]) {
self.viewControllers = views().map {
let host = UIHostingController(rootView: $0.view)
host.tabBarItem = $0.barItem
// The SwiftUI Lab
// Website: https://swiftui-lab.com
// Article: https://swiftui-lab.com/alignment-guides
import SwiftUI
class Model: ObservableObject {
@Published var minimumContainer = true
@Published var extendedTouchBar = false
@Published var twoPhases = true
// The SwiftUI Lab
// Website: https://swiftui-lab.com
// Article: https://swiftui-lab.com/alignment-guides
import SwiftUI
class Model: ObservableObject {
@Published var minimumContainer = true
@Published var extendedTouchBar = false
@Published var twoPhases = true
@serefercelik
serefercelik / tmux.md
Created August 26, 2020 17:08 — forked from aokolish/tmux.md
quick way to kill all tmux sessions

This is the quickest way I've found to kill all tmux sessions

# detach from each session
<prefix>d

# kill tmux and all sessions
tmux kill-server
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16