Skip to content

Instantly share code, notes, and snippets.

View DingSoung's full-sized avatar
:octocat:
Focusing

DingSoung

:octocat:
Focusing
View GitHub Profile
@paulkaplan
paulkaplan / colorTempToRGB.js
Last active March 4, 2024 10:29
Color Temperature to RGB
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;
@fanzeyi
fanzeyi / v2ex_api.md
Last active April 29, 2024 08:43
V2EX API
func encode<T>(var value: T) -> NSData {
return withUnsafePointer(&value) { p in
NSData(bytes: p, length: sizeofValue(value))
}
}
func decode<T>(data: NSData) -> T {
let pointer = UnsafeMutablePointer<T>.alloc(sizeof(T.Type))
data.getBytes(pointer)
  1. 使用 BaseSystem.dmg 的方法制作安装 USB,只需要刻录 BaseSystem.dmg ,拷贝 Packages 覆盖原 Packages 拷贝 BaseSystem.chunklistBaseSystem.dmg 至 USB 根目录
  2. 用这里提供的 CLOVER
  3. 用这里提供的 kext
  4. 无线,有线,声音,trim,键鼠,屏幕亮度,USB 3.0 就都好了。
  5. 更新:不要使用 GenericUSBXHCI 了,要用 USB 3.0 搜索 Patched AppleUSBXHCI v710.4.11 (10.10.2) 下载并按说明替换系统相应 kext。

https://blog.daliansky.net/Hackintosh-long-term-maintenance-model-checklist.html

https://blog.daliansky.net/archives/

@mrackwitz
mrackwitz / Podfile.rb
Last active June 14, 2018 13:13
Force Duplicate Pod Targets by Pre Install Hook
# This will enforce that the pods with the names in the list below will be duplicated.
targets_to_duplicate = %w(AFNetworking)
pre_install do |installer|
pod_targets = installer.pod_targets.flat_map do |pod_target|
targets_to_duplicate.include?(pod_target.name) ? pod_target.scoped : pod_target
end
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.pod_targets = pod_targets.select do |pod_target|
pod_target.target_definitions.include?(aggregate_target.target_definition)
end
@oc2pcoj
oc2pcoj / Good IOS RTSP Player.md
Last active June 26, 2024 09:08
iOS RTSP player for IP video cameras
@laobubu
laobubu / hypermd-v2ex.js
Last active March 5, 2019 06:55
HyperMD for V2EX
/**
HyperMD breaks the wall between Preview and Writing for Markdown.
@see https://github.com/laobubu/HyperMD/
此脚本可以帮助你在 V2EX 发帖界面体验 HyperMD 的强大功能。
使用方法:
1. 打开发帖界面 https://www.v2ex.com/new
2. 在地址栏输入以下地址并回车 [^1]