Skip to content

Instantly share code, notes, and snippets.

@jwamin
jwamin / Breathe.playground
Last active December 19, 2023 03:26
watchOS "Breathe" Animation
import UIKit
import PlaygroundSupport
var str = "Hello, playground"
class ViewController : UIViewController {
var breatheView: BreatheView {
self.view as! BreatheView
@MightyPork
MightyPork / usb_hid_keys.h
Last active March 20, 2026 10:23
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@binderclip
binderclip / deploy-flask-gunicorn-supervisor-nginx.md
Last active March 22, 2023 09:17
Flask Gunicorn Supervisor Nginx 项目部署小总结

Flask Gunicorn Supervisor Nginx 项目部署小总结

服务器的基本连接和配置

SSH 连接

使用公钥私钥来登陆而不是账号密码,公钥私钥需要简单的在本地生成一下。Github 的生成 SSH 公钥私钥的教程:Generating SSH keys

可能需要使用 -i 参数选择一下本地的私钥,一个示例的 ssh 连接如下:

@figgleforth
figgleforth / UIImage+pixelData.swift
Last active January 17, 2023 19:26
Extract RGBA pixel data from an UIImage in Swift
//
// UIImage+pixelData.swift
//
// Created by Bojan Percevic on 5/25/15.
// Copyright (c) 2015. All rights reserved.
//
import Foundation
extension UIImage {
@hishma
hishma / versionInSettings.md
Last active May 31, 2022 07:26
Display iOS app version in settings

To display the current version of an iOS app in the settings

  1. Add an entry like this in Settings.bundle/Root.plist
<key>PreferenceSpecifiers</key>
<array>
  <dict>
    <key>Type</key>
 PSTitleValueSpecifier
@ntnmrndn
ntnmrndn / UIImage+convertToGreyScale.swift
Created January 20, 2015 06:33
A swift UIImage category to convert an image to black and white (truly, in shades of gray); preserving alpha as alpha.
//
// UIImage+convertToGreyScale.swift
// itooch
//
// Created by Antoine Marandon on 15/01/2015.
// Copyright (c) 2015 eduPad. All rights reserved.
//
import Foundation
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active March 20, 2026 03:32
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S