Skip to content

Instantly share code, notes, and snippets.

@hjeffrey
hjeffrey / translate_xocde_code_2_word.py
Created February 24, 2021 07:31
iOS项目输出纯代码的word文档
#!/usr/bin/python
# -*- coding:utf-8 -*-
#
# iOS项目输出纯代码的word文档
# .m 与 .swift 文件
# 去掉空行
# 去掉注释,包括/** ... */,// 和 #pragma
# 去掉引用头文件
import os
@hjeffrey
hjeffrey / replace_kangxi_radical.py
Last active April 7, 2024 12:14
把康熙部首替换为简体中文
#!/usr/bin/python
# -*- coding:utf-8 -*-
# 把康熙部首替换为简体中文
import os
import sys
import glob
import json
# 查看编码
@hjeffrey
hjeffrey / ramdisk.sh
Created October 22, 2019 04:05
Ramdisk For XCode
# install to $HOME/.ramdisk
# initramdisk.sh - make a ramdisk, the default size is 6GB.
# syncramdisk.sh - sync files of ramdisk to disk, when logout.
# makeRamDiskWhenRestart.sh - make Hook, LoginHook and LogoutHook. LoginHook for initramdisk.sh, LogoutHook for syncramdisk.sh.
# moveXcodeCacheToRamDisk.sh - run shell above, then move xcode cache folder to ramdisk.
# ---------------- initramdisk.sh ------------------
#!/usr/bin/env sh
@hjeffrey
hjeffrey / Install_ipa_to_simulator.scpt
Last active April 27, 2021 16:10
Install ipa to Simulator of Xcode
--
-- Project: Install IPA to Simulator
-- Author: Jeffrey Jia
-- Date: 2017 年 9 月 26 日
--
on open fileList
repeat with theFilePath in fileList
set fileInfo to info for file theFilePath
if name of fileInfo ends with ".ipa" then
@hjeffrey
hjeffrey / clang-format
Created July 19, 2016 06:20
custom format for clang-format
# 基础样式
BasedOnStyle: LLVM
## 方案 LK_Cpp Should be used for C, C++, ObjectiveC, ObjectiveC++.
Language: Cpp
# 缩进宽度
IndentWidth: 4
# 圆括号的换行方式
@hjeffrey
hjeffrey / create pem
Created June 12, 2016 09:59
make pem form p12 and cer
openssl x509 -in aps.cer -inform DER -out aps.pem -outform PEM
openssl pkcs12 -in aps.p12 -out key.pem -nocerts
cat aps.pem key.pem > release.pem
@hjeffrey
hjeffrey / pre-commit
Created March 28, 2016 10:15 — forked from cleichner/pre-commit
Pre-commit hook to check for NSLog statements in iOS repos
#!/bin/sh
# name this .git/hooks/pre-commit
# chmod +x .git/hooks/pre-commit
# enjoy
# so it will work on empty repos
if git-rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
@hjeffrey
hjeffrey / framework.sh
Created September 23, 2015 09:50
make lib to framework
# Sets the target folders and the final framework product.
# 如果工程名称和Framework的Target名称不一样的话,要自定义FMKNAME# 例如: FMK_NAME = "MyFramework"
FMK_NAME=${PROJECT_NAME}
# Install dir will be the final output to the framework.
# The following line create it in the root folder of the current project.
INSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework
# Working dir will be deleted after the framework creation.
WRK_DIR=build
@hjeffrey
hjeffrey / build.sh
Created August 4, 2015 08:42
完成iOS app编译,打包ipa,上传ftp备份,发送邮件
#!/bin/sh
# build.sh
#
# Created by Jia Yuhui on 24/06/2015.
# Copyright 2015 Jia Yuhui. All rights reserved.
env=$1
sleepsecond=3
@hjeffrey
hjeffrey / resign.sh
Created July 20, 2015 14:11
Resign ipa.
#!/bin/sh
#
# resign.sh
#
# Created by Jia Yuhui on 08/07/2015.
# Copyright 2015 Jia Yuhui. All rights reserved.
currentPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CERTIFICATE="iPhone Developer: xxx (xxxxxxxx)" # must be in keychain