# 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
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
framework 'Cocoa' | |
class NSColor | |
def toCGColor | |
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
## approach #1 | |
# components = Array.new(4){Pointer.new(:double)} | |
# color_RGB.getRed(components[0], | |
# green: components[1], | |
# blue: components[2], |
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
require 'rubygems' | |
require 'em-proxy' | |
require 'http_tools' | |
require 'uuid' | |
# > ruby em-proxy-http.rb | |
# > curl --proxy localhost:8080 www.google.com | |
host = "0.0.0.0" | |
port = 8080 |
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 "NSString+UnicodeLength.h" | |
@implementation NSString (UnicodeLength) | |
/** | |
* @param range a unicode codepoint range, as described in twitter | |
* @return rante a NSRange for the string | |
* @see https://dev.twitter.com/overview/api/counting-characters | |
*/ | |
- (NSRange)composedRangeWithRange:(NSRange)range { |
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
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" |