Skip to content

Instantly share code, notes, and snippets.

How to use Bundler and RubyGems on WebAssembly

# Download prebuilt ruby
curl -LO https://github.com/ruby/ruby.wasm/releases/download/2022-05-11-a/ruby-head-wasm32-unknown-wasi-full.tar.gz
tar xfz ruby-head-wasm32-unknown-wasi-full.tar.gz

# Install the same version of native ruby to avoid bundler version mismatch in "BUNDLED WITH" of Gemfile.lock
rvm install 3.2.0-preview1
rvm use 3.2.0-preview1
@siuying
siuying / RemoteImage.podspec
Last active December 1, 2020 03:37
RemoteImage podspec
Pod::Spec.new do |spec|
spec.name = "RemoteImage"
spec.version = "4.0.0"
spec.summary = "Swift package for a SwiftUI remote image view."
spec.description = <<-DESC
This Swift package provides a wrapper view around the existing SwiftUI Image view which adds support for showing and caching remote images. In addition you can specify a loading and error view.
DESC
spec.homepage = "https://github.com/crelies/RemoteImage"
spec.license = "MIT"
spec.author = { "Christian Elies" => "" }
@siuying
siuying / Buffer.swift
Last active May 22, 2020 19:01
Type erasure
import Foundation
// Base on
// https://github.com/bignerdranch/type-erasure-playgrounds/blob/master/playgrounds/Type_Erasure_Slides.playground/Contents.swift
protocol Buffer {
associatedtype T
func insert(_ value: T)
}
@siuying
siuying / build.sh
Created May 7, 2020 12:35
build catalyst in cmake
cmake -G Xcode .. -DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode_11.4.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk \
-DCMAKE_CXX_FLAGS="-target x86_64-apple-ios13.1-macabi -iframework ${CMAKE_OSX_SYSROOT}/System/iOSSupport/System/Library/Frameworks" \
-DCMAKE_C_FLAGS="-target x86_64-apple-ios13.1-macabi -iframework ${CMAKE_OSX_SYSROOT}/System/iOSSupport/System/Library/Frameworks"
https://item.taobao.com/item.htm?spm=a1z09.2.0.0.2a7a2e8dILHPyZ&id=571356247263&_u=k3kq575k1144
@siuying
siuying / SSDT-PEGP-Spoof.aml
Created May 1, 2019 13:17
Fixing sleep problem on Hackintosh
DefinitionBlock ("", "SSDT", 2, "hack", "spoof", 0)
{
// ASUS X299 PRIME PCIE Slot-1
Method(_SB.PC02.BR2A.PEGP._DSM, 4)
{
If (!Arg2) { Return (Buffer() { 0x03 } ) }
Return (Package()
{
"name", Buffer() { "#display" },
"IOName", "#display",
@siuying
siuying / Brewfile
Last active November 20, 2023 15:13 — forked from hlb/Brewfile
Clean Install Script
cask_args appdir: '/Applications'
tap 'homebrew/cask'
tap "homebrew/cask-fonts"
tap 'homebrew/cask-versions'
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/services"
brew "git"
brew "git-lfs"
{
"message": "ok",
"id": "4C657635-5A59-4EE3-BEDB-BF59DACF1FD7"
}
#
# Be sure to run `pod lib lint RxOptional.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'RxOptional'