This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hooks/use-clipboard-api.js | |
import { useState, useCallback } from 'react' | |
function useClipboardApi() { | |
const [content, setContent] = useState(null) | |
const askPermission = useCallback(async queryName => { | |
try { | |
const permissionStatus = await navigator.permissions.query(queryName) | |
return permissionStatus.state === 'granted' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Used to identify traits of the current UI Environment - especially useful for cross-platform code | |
public struct MNCUITraits: Withable { | |
/// Does *not* identify the device type, but the idiom of the layout to apply | |
/// This means that e.g. on iPad the layoutIdiom can be `.phone`, if run in Split Screen or SlideOver | |
public enum LayoutIdiom { | |
case phone(hasRoundCorners: Bool) | |
case pad(hasRoundCorners: Bool) | |
case mac | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Hotbar Shortcuts for Minecraft Bedrock Edition by TwistedAsylumMC | |
; This script allows Windows 10 users to use the 1-9 keys in their inventories | |
; to act as shortcuts to easily move items in and out of their hotbar slots. | |
; How to use this script: | |
; 1. Download AutoHotKey (If you haven't already) from https://www.autohotkey.com/download/ | |
; 2. Save this file to your device and double click it to start the script | |
; 3. Load up your Minecraft client and go inside of a world | |
; 4. Inside your inventory, you can use the 1-9 keys to swap items around |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public enum ModelName: String { | |
case simulator | |
case iPod1, iPod2, iPod3, iPod4, iPod5 | |
case iPad2, iPad3, iPad4, iPad5, iPad6 | |
case iPadAir, iPadAir2, iPadAir3 | |
case iPadMini, iPadMini2, iPadMini3, iPadMini4, iPadMini5 | |
case iPadPro9_7, iPadPro10_5, iPadPro12_9, iPadPro2_12_9, iPadPro11, iPadPro3_12_9 | |
case iPhone4, iPhone4S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useReducer, useRef } from "react"; | |
const initialState = { | |
isLoading: false, | |
data: null, | |
err: null, | |
cancel: () => {} | |
}; | |
const reducer = (state, { type, payload }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use pocketmine\network\mcpe\protocol\PacketPool; | |
use pocketmine\utils\BinaryDataException; | |
require_once "vendor/autoload.php"; | |
$packetPool = PacketPool::getInstance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nthreads CpuThread CpuProcess IoThread IoProcess | |
1.000000e+00 3.144138e-01 3.251026e-01 1.001459e+00 1.003092e+00 | |
2.000000e+00 6.895385e-01 3.517330e-01 1.001673e+00 1.006315e+00 | |
3.000000e+00 1.031855e+00 3.544722e-01 1.001369e+00 1.006683e+00 | |
4.000000e+00 1.421367e+00 3.659563e-01 1.001482e+00 1.004262e+00 | |
5.000000e+00 1.758888e+00 5.339592e-01 1.001763e+00 1.009259e+00 | |
6.000000e+00 2.055879e+00 5.403588e-01 1.001714e+00 1.008378e+00 | |
7.000000e+00 2.421100e+00 6.488514e-01 1.002105e+00 1.008495e+00 | |
8.000000e+00 2.919692e+00 6.753159e-01 1.001981e+00 1.012398e+00 | |
9.000000e+00 3.445944e+00 8.028872e-01 1.002099e+00 1.012729e+00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AVPlayerDelegate.swift | |
// | |
// Created by Maxim Kotliar on 7/30/18. | |
// | |
import AVFoundation | |
@objc protocol AVPlayerDelegate: class { | |
@objc optional func playerDidStartPlayback() | |
@objc optional func playerDidPausePlayback() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDeviceExtension.swift | |
// | |
// Created by shankars on 3/15/19. | |
// Copyright © 2019 shankars. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use Mdanter\Ecc\Crypto\{Key\PrivateKeyInterface, Signature\Signature}; | |
use Mdanter\Ecc\Serializer\PrivateKey\{DerPrivateKeySerializer, PemPrivateKeySerializer}; | |
use Mdanter\Ecc\Serializer\PublicKey\{DerPublicKeySerializer, PemPublicKeySerializer}; | |
use Mdanter\Ecc\Serializer\Signature\DerSignatureSerializer; | |
class JWT{ |
NewerOlder