Skip to content

Instantly share code, notes, and snippets.

View gboyegadada's full-sized avatar

Gboyega Dada gboyegadada

  • Nigeria
  • X @yegadotlog
View GitHub Profile
@ChrisMash
ChrisMash / PlayerTimeView.swift
Created March 10, 2020 19:09
A SwiftUI View to display an AVPlayer's currentTime from PlayerTimeObserver's publisher
import SwiftUI
import AVFoundation
struct PlayerTimeView: View {
let timeObserver: PlayerTimeObserver
@State private var currentTime: TimeInterval = 0
var body: some View {
Text("\(Utility.formatSecondsToHMS(currentTime))")
.onReceive(timeObserver.publisher) { time in
@nilsmagnus
nilsmagnus / sign_and_verify_test.go
Last active July 29, 2025 13:19
Sign a message and verify signature with go using PKCS1. Compatible with java (SHA256withRSA)
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"testing"
)
@eugenebokhan
eugenebokhan / CGImage+Resize.swift
Last active March 19, 2025 16:15
UIImage + Resize
import CoreGraphics
import Accelerate
import CoreImage
import UIKit
extension CGImage {
public enum Error: Swift.Error {
case imageResizingFailed
case cgContextCreationFailed
@tkersey
tkersey / .2026.md
Last active March 8, 2026 15:23
For future reference but maybe not.

Quick access

2026

March

    1. PterodactylCore contains the core syntax, semantic domain, evaluator, and conversion checker. This library is completely indepenent from the rest of the system.
    2. PterodactylKernel contains the rules of Martin-Löf type theory, implemented as closure conditions on functions that produce core terms from an environment and a goal. I will discuss this more below. This depends only on PterodactylCore and is completely independent of concrete syntax. The kernel is trusted, and its outputs are (in LCF style) unforgeable. > 1. PterodactylSyntax contains the concrete syntax of the Pterodactyl, implemented with Roslyn-style homogeneous “green trees”. This library includes the layout lexer and the parser. This library is independent of the other parts of the sy
@josephspurrier
josephspurrier / values_pointers.go
Last active May 15, 2025 14:43
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory