Skip to content

Instantly share code, notes, and snippets.

View ryohey's full-sized avatar
👶

ryohey ryohey

👶
View GitHub Profile
@bholmesdev
bholmesdev / react-async-await-rfc-notes.md
Created October 15, 2022 18:22
React async / await RFC notes

React async-await RFC

What I know coming in

React server components (initial proposal) was a so-so DX that solved an important problem: I want to render a React component on the server only, with APIs to easily fetch data for rendering.

  • Pulls on islands architecture concepts (hi Astro.build!)
  • Improves full-stack ergonomics
@ViewBuilder
private func build<#name#>(_ viewStore: ViewStoreType) -> some View {
}
@edudnyk
edudnyk / ViewTestCase.swift
Last active March 5, 2024 06:39
Utils for _ViewTest
import SwiftUI
import XCTest
extension UIHostingController: _Test where Content == AnyView {}
extension UIHostingController: _ViewTest where Content == AnyView {
public func initRootView() -> AnyView {
return rootView
}
public func initSize() -> CGSize {
sizeThatFits(in: UIScreen.main.bounds.size)
@dezinezync
dezinezync / fastfile.rb
Created August 20, 2021 02:46
Build a macOS App and notarize it using Fastlane
default_platform(:mac)
platform :mac do
before_all do
# Make sure we start off with a clean slate
ensure_git_status_clean
end
desc "Create a notarized build of the macOS App"
lane :notarized do
@willeccles
willeccles / sockets.h
Last active February 6, 2024 22:52
Cross-platform socket header for both POSIX sockets and Winsock
/*
* File: sockets.h
* Author: Will Eccles
* Date: 2020-03-12
*
* 1. Description
*
* This header attempts to make it easy to use sockets across platforms,
* for both Windows and POSIX systems. While Winsock is often somewhat
* compatible with Berkeley sockets, it is not strictly compatible,
@stepney141
stepney141 / BookmarkAPI_en.md
Last active April 4, 2023 01:45
(DEPRECATED) Twitter Undocumented Endpoints for Bookmark
@yoannmoinet
yoannmoinet / icons.sh
Last active April 25, 2024 00:30
Mac OS X icon.icns
#!/bin/sh
#Usage: ./icons.sh ../assets/media/icon_color_1024.png ../assets/icons
name=$(basename "$1" ".png")
dir=$(cd "$(dirname "$2")"; pwd)/$(basename "$2")
mkdir $dir/$name.iconset
sips -Z 16 --out $dir/$name.iconset/icon_16x16.png $1
sips -Z 32 --out $dir/$name.iconset/icon_16x16@2x.png $1
sips -Z 32 --out $dir/$name.iconset/icon_32x32.png $1
@IanKeen
IanKeen / Example.swift
Last active March 1, 2023 18:15
Lightweight styling setup using UIAppearance
import PlaygroundSupport
// using constrained static members on `Style` we can create presets
extension Style where T: UIButton {
static var global: Style<UIButton> {
return .init { button in
button.backgroundColor = .blue
button.setTitleColor(.red, for: .normal)
}
}
@doggan
doggan / TestOverlayAudio.java
Created June 23, 2017 00:57
Use MediaMuxer to overlay a WAV onto an MP4
package com.test.mytest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.app.ProgressDialog;
import android.media.MediaCodec;
@matthewjberger
matthewjberger / notes.md
Last active March 11, 2024 10:21
How to make an electron app using Create-React-App and Electron with Electron-Builder.