https://code-boxx.com/php-push-notifications/
Copyright by Code Boxx
https://code-boxx.com/php-push-notifications/
Copyright by Code Boxx
import Foundation | |
private final class RunBlocking<T, Failure: Error> { | |
fileprivate var value: Result<T, Failure>? = nil | |
} | |
extension RunBlocking where Failure == Never { | |
func runBlocking(_ operation: @Sendable @escaping () async -> T) -> T { | |
Task { | |
let task = Task(operation: operation) |
// | |
// ContentView.swift | |
// ActivityRingAnimation WatchKit Extension | |
// | |
// Created by AppleDesignDev on 1/25/22. | |
// | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
TimelineView(.periodic(from: .now, by: 1.0)) { timeline in |
import UIKit | |
// Services conforming to protocols. | |
// SOLID: Depend on abstractions, not concrete implementations. Dependency Inversion principle | |
// DECLARE FIRST SERVICE | |
protocol MyFirstServiceProtocol { | |
func myFirstMethod() | |
} |
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612) | |
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m | |
// | |
// If SIP off: | |
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari | |
// | |
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many | |
// features (eg saved logins) won't be readable by the resigned app: | |
// cp -a /Applications/Safari.app ./ | |
// codesign --remove Safari.app/Contents/MacOS/Safari |
/* | |
Written By Pan ZhenPeng(@peterpan980927) of Alibaba Security Pandora Lab | |
use it on macOS: cc poc.c -o poc while True; do ./poc ; done | |
*/ | |
#include <errno.h> | |
#include <signal.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
import tensorflow as tf #We need tensorflow 2.x | |
import numpy as np | |
#The hashlength in bits | |
hashLength = 256 | |
def buildModel(): | |
#we can set the seed to simulate the fact that this network is known and doesn't change between runs | |
#tf.random.set_seed(42) | |
model = tf.keras.Sequential() |
// Original article here: https://www.fivestars.blog/code/redacted-custom-effects.html | |
import SwiftUI | |
// MARK: Step 1: Create RedactionReason | |
public enum RedactionReason { | |
case placeholder | |
case confidential |
/** | |
* MacEditorTextView | |
* Copyright (c) Thiago Holanda 2020-2021 | |
* https://twitter.com/tholanda | |
* | |
* MIT license | |
*/ | |
import Combine | |
import SwiftUI |
console.table((function listAllEventListeners() { | |
const allElements = Array.prototype.slice.call(document.querySelectorAll('*')); | |
allElements.push(document); // we also want document events | |
const types = []; | |
for (let ev in window) { | |
if (/^on/.test(ev)) types[types.length] = ev; | |
} | |
let elements = []; | |
for (let i = 0; i < allElements.length; i++) { |