Skip to content

Instantly share code, notes, and snippets.

@jackyshan
jackyshan / modifyi386x86_64scriptshell.shell
Created April 10, 2017 03:14
脚本修改i386 x86_64上传App Store报错
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
@jackyshan
jackyshan / liporemovearchive.sh
Created April 10, 2017 03:11
删除framework架构i386,x86_64
lipo -remove i386 RxSwift.framework/RxSwift -output RxSwift.framework/RxSwift
lipo -remove x86_64 RxSwift.framework/RxSwift -output RxSwift.framework/RxSwift
@jackyshan
jackyshan / xcode_block_mark.swift
Last active May 23, 2017 06:47
xcode代码块
// MARK: - <#name#>
@jackyshan
jackyshan / getCoupons.js
Created December 19, 2016 06:56
分享领券刷手机号
mobs = new Array()
for (var index = 10; index < 100; index++) {
var mobile = '186201121'+index
mobs.push(mobile)
}
var index = 0
window.setInterval(function(){
mobile = mobs[index++]
$.ajax('/share/get_free_service',{
@jackyshan
jackyshan / website_easybuy.js
Created December 17, 2016 03:27
官网购一键购链接弹出
defineClass("YTPlatWebsiteDetailViewController", {
//instance method definitions
webViewDidStartLoad: function(webView) {
self.progressView().setProgress_animated(0.9, true)
self.buyBtn().setSelected(true)
},
webViewDidFinishLoad: function(webView) {
self.progressView().setProgress_animated(1.0, true)
self.buyBtn().setSelected(true)
}
@jackyshan
jackyshan / xls_db.py
Created December 7, 2016 03:56
处理excel导出db数据
import xlrd
data = xlrd.open_workbook('xx.xls')
fo = open("xx.txt", "w")
for i in range(len(data.sheets())):
table = data.sheets()[i]
nrows = table.nrows
for row in range(nrows):
@jackyshan
jackyshan / findcontent.py
Created December 6, 2016 06:18
Python查找当前目录下文件的匹配内容
import os
for file in os.listdir(os.getcwd()):
f = open(file)
content = f.readline()
while content:
if 'xxx' in content :
print content
pass
content = f.readline()
@jackyshan
jackyshan / sendmail.py
Created December 6, 2016 03:30
python批量发送邮件
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib2, time, string, random
email = ''
title = raw_input("输入邮件标题:")
if len(title) <= 0:
title = '标题'
@jackyshan
jackyshan / shell_qq.sh
Created December 5, 2016 07:16
shell遍历目录文件导入qq邮箱
#!bin/sh
for file in ./*
do
if test -f $file
then
grep "@qq.com" $file >> xxx_qq_all.txt
fi
done
@jackyshan
jackyshan / uiwebview_Authorization.m
Created November 29, 2016 06:27
uiwebview代理http认证
NSString *userPasswordString = [NSString stringWithFormat:@"%@:%@", username, password];
NSData * userPasswordData = [userPasswordString dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64EncodedCredential = [userPasswordData base64EncodedStringWithOptions:0];
NSString *authString = [NSString stringWithFormat:@"Basic %@", base64EncodedCredential];
config.HTTPAdditionalHeaders = @{@"Proxy-Authorization": authString};