Skip to content

Instantly share code, notes, and snippets.

View songxing10000's full-sized avatar

xingsong songxing10000

  • ChengDu
View GitHub Profile
@songxing10000
songxing10000 / swift
Created March 8, 2024 04:04
AlibabacloudOcrApi20210707图片转文字
//
// Img2textVC.swift
// AudioText
//
// Created by dfpo on 2024/3/8.
// 图片转文字
import UIKit
import TOCropViewController
@songxing10000
songxing10000 / uploadIpaToServerUseSSH
Created September 14, 2017 15:40
uploadIpaToServerUseSSH
set appName to "Terminal"
set appID to bundle identifier of (info for (path to application appName))
set theFolder to choose folder
tell application "Finder"
set fileList to every file of theFolder --whose name extension is "ipa"
if (count of fileList) > 0 then
repeat with theFile in fileList
@songxing10000
songxing10000 / 获取app窗口所有控件
Created September 13, 2017 16:05
获取app窗口所有控件
tell application "System Events"
tell application "企业微信"
activate
tell application "System Events"
tell process "企业微信"
get entire contents of window 1
end tell
end tell
end tell
@songxing10000
songxing10000 / 自动点击企业微信界面的登录按钮
Created September 13, 2017 16:05
自动点击企业微信界面的登录按钮
tell application "System Events"
tell application "企业微信"
activate
end tell
if not (exists (button "登录" of window 1 of application process "企业微信" of application "System Events")) then
tell application "企业微信"
quit
end tell
@songxing10000
songxing10000 / openOrCloseApp
Created September 13, 2017 16:04
openOrCloseApp
tell application "System Events"
get name of every process whose name is "企业微信"
if result is not {} then
tell application "企业微信"
quit
end tell
@interface AdViewController ()
/** 定时器 */
@property (nonatomic, strong) NSTimer *timer;
@property (nonatomic, strong) UIButton *adButton;
@end
@implementation AdViewController
NSUInteger secondsCountDown = 3;//倒计时秒数
[BaseService postJSONWithUrl:APP_URL parameters:nil success:^(id responseObject)
{
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil removingNulls:YES ignoreArrays:NO];
NSArray *infoArray = [dic objectForKey:@"results"];
if ([infoArray count])
{
NSDictionary *releaseInfo = [infoArray objectAtIndex:0];
NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
NSString *currentVersion = [[infoDic objectForKey:@"CFBundleShortVersionString"] stringByReplacingOccurrencesOfString:@"." withString:@""];
NSString *lastVersion = [[releaseInfo objectForKey:@"version"] stringByReplacingOccurrencesOfString:@"." withString:@""];
@songxing10000
songxing10000 / UILabel+lineSpacing.m
Last active February 22, 2017 02:00
UILabel行间距
NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:self.illLabel.text];
NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle1 setLineSpacing:50.0];
[attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [self.illLabel.text length])];
[self.illLabel setAttributedText:attributedString1];
@songxing10000
songxing10000 / RSAEncryptor.h
Last active February 22, 2017 01:59
private_key.p12 public_key.der
#import <Foundation/Foundation.h>
@interface RSAEncryptor : NSObject
/**
* 加密方法
*
* @param str 需要加密的字符串
* @param path '.der'格式的公钥文件路径
*/
@songxing10000
songxing10000 / RSAEncryptor.m
Created February 22, 2017 01:59
private_key.p12 public_key.der
#import "RSAEncryptor.h"
#import <Security/Security.h>
@implementation RSAEncryptor
static NSString *base64_encode_data(NSData *data){
data = [data base64EncodedDataWithOptions:0];
NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
return ret;
}