Skip to content

Instantly share code, notes, and snippets.

View babyking's full-sized avatar

Baby King babyking

View GitHub Profile
@Kyle-Ye
Kyle-Ye / XcodeLLM.md
Last active July 1, 2024 19:25
Enable XcodeLLM for ChinaSKU Mac on macOS 15 Beta 1

Warning

The following guide need to disable SIP to work.

Please confirm the risk of disabling the SIP by yourself.

Another solution which does not require disabling SIP is currently under investigation.

Step 0

Reboot into Recovery OS + Disable SIP

@haozes
haozes / update_whatsnew.py
Last active October 29, 2023 09:10
Update App Connect whats new info
# need install asconnect: pip install asconnect, and openai: pip install openai
import asconnect
import os
import openai
#api key: https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
APPCONN_APIKEY_ID = "xxxxx"
APPCONN_ISSUER_ID = "xxxxxxx"
APPCONN_KEY_FILE = "xxxxx.p8"
@ABridoux
ABridoux / WindowPosition.swift
Last active April 14, 2024 12:01
Logic to easily set a NSWindow's origin horizontally and vertically in a screen (AppKit and SwiftUI)
// Free to use
// Written by Alexis Bridoux - https://github.com/ABridoux
import AppKit
#if canImport(SwiftUI)
import SwiftUI
#endif
// MARK: Model
@johndpope
johndpope / JPMixer.swift
Last active September 14, 2022 16:21
SongProcessor AudioKit - hack to play multiple files at once
//
// Mixer.swift
// SongProcessor
//
// Created by Pope, John on 8/10/17.
// Copyright © 2017 AudioKit. All rights reserved.
//
import Foundation
import AudioKit
@ttscoff
ttscoff / init.lua
Last active January 9, 2024 23:44
Hammerspoon config examples for hyper key
-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")
-- Trigger existing hyper key shortcuts
k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end)
-- OR build your own
launch = function(appname)
@Kapenaar
Kapenaar / thin.yml
Last active September 23, 2022 03:01
Default config file for thin web server with comments
### SERVER OPTIONS ###
## Bind Address
#address: HOST # Default: 0.0.0.0
## Bind port. If using multiple thin servers,
## they will bind to (PORT + n) where n is the server number
#port: PORT # Default: 3000
@h2non
h2non / json-post.swift
Last active September 11, 2022 01:38
JSON POST example with Alamofire
let parameters = [
"username": "foo",
"password": "123456"
]
Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON)
// -> HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}}
@wisaruthk
wisaruthk / FVRInAppPurchaseVC.swift
Last active July 15, 2023 16:35
iOS In App Purchase Example with appusername
//
// FVRInAppPurchaseVC.swift
// favroutes
//
// Created by wisaruthk on 10/8/2558 BE.
// Copyright © 2558 kojo. All rights reserved.
//
import UIKit
import StoreKit
@srikanthjeeva
srikanthjeeva / https GET request with Basic Auth in Ruby
Created January 28, 2015 20:33
https GET request with Basic Auth in Ruby
require 'net/http'
require 'net/https'
require 'uri'
uri = URI('https://example.com/rest/api/2/1')
Net::HTTP.start(uri.host, uri.port,
:use_ssl => uri.scheme == 'https',
:verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|