Skip to content

Instantly share code, notes, and snippets.

View MasahiroSakoda's full-sized avatar

masahiroSkd MasahiroSakoda

  • Kanagawa Pref. Japan
View GitHub Profile
@0xLeif
0xLeif / metal_01_swiftui.swift
Last active May 6, 2023 11:47
Metal + SwiftUI
//
// ContentView.swift
// MetalSwiftUI
//
// Created by Zach Eriksen on 9/8/20.
// Copyright © 2020 oneleif. All rights reserved.
//
// Inspired [MetalUI](https://github.com/0xLeif/MetalUI)
import SwiftUI
//
// AVPlayer+Singleton.swift
// DeveloperBelt
//
// Created by Egzon Pllana on 11/5/19.
// Copyright © 2019 Native Coders. All rights reserved.
//
import Foundation
import MediaPlayer
//
// MyMetalWaterfall.swift
// version 0.1.105 (updated for Swift 5)
//
// Demonstrates using a MetalKit compute shader to render a live waterfall RGB bitmap
// into a UIView
//
// This is a single file iOS app
//
// It includes AppDelegate for a minimal demonstration app
@scottopell
scottopell / fix_exfat_drive.md
Last active March 9, 2024 12:08
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@karlding
karlding / itunes-artist-photos.md
Created March 3, 2016 05:17
Grab iTunes image artwork from the DOM using the Open Graph meta tags

iTunes Artist Photos

The iTunes API doesn't provide a way to grab artist images, but the iTunes website uses Open Graph meta tags, which embeds a meta tag with a property attribute value set to og:image. As it turns out, this seems to be the same image used in the iTunes artwork.

The URL structure is similar to the artworkUrl values returned by the API, but what concerns us here is the part I've indicated at the end of the URL.

http://is3.mzstatic.com/image/thumb/Music7/v4/68/68/41/68684190-833b-bfb4-5018-e5a2e6f69eb0/source/1200x630bf.jpg
                                                                                                   └─ widthxheight
@parmentf
parmentf / GitCommitEmoji.md
Last active April 26, 2024 09:53
Git Commit message Emoji
@yudai
yudai / gist:6f8f44ac878c41eaf7dc
Last active November 7, 2023 08:35
Google v. Oracle API著作権裁判

Oracle v. GoogleのAPI著作権裁判の話

OracleとGoogleの判決文を斜め読む」を読んで裁判の経緯は理解できたものの、判決の詳細があまり理解できなかったので判決文を自分で読んだ。法律的な難しさはあまりなく、技術的な論点と関係する条文および過去の判例などが非常にわかりやすく解説されており、判決の根拠もたとえ話を交えて書かれているなど非常に読みやすい印象を受けた。

全体の内容としては比較的単純で「あらゆるプログラムのコードは著作権で保護される。ただしFair Useによる合法的な利用に関しては差し戻し審で審議せよ」という事のようだ。実は「API」という言葉は一切判決文には出てこないため、内容を良く読む必要がある。

17 U.S.C. 102(b)を巡るGoogleの主張

@adamlogan
adamlogan / photosclassdump.txt
Created May 27, 2015 08:59
Attempt to find string to disable auto launching of Photos application on Mac OSX Yosemite
This file has been truncated, but you can view the full file.
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#pragma mark Blocks
typedef void (^CDUnknownBlockType)(void); // return type and parameters are unknown
@onk
onk / .rubocop.yml
Last active January 15, 2018 02:30
僕の使っている .rubocop.yml
# rubocop v0.35.0 から inherit_gem という機能が増えたので gem にしました
# https://github.com/onk/onkcop
inherit_gem:
onkcop: "config/rubocop.yml"
@yawara
yawara / hts-engine-api.rb
Created February 8, 2015 13:31
Open JTalk for Homebrew
class HtsEngineApi < Formula
homepage "http://hts-engine.sourceforge.net/"
url "https://downloads.sourceforge.net/project/hts-engine/hts_engine%20API/hts_engine_API-1.09/hts_engine_API-1.09.tar.gz"
sha1 "1c264c2bd29c87f49ace2c5d2b2fcd6b5b44b12c"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end