Skip to content

Instantly share code, notes, and snippets.

ZX bumaociyuan

  • Chengdu
Block or report user

Report or block bumaociyuan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bumaociyuan /
Last active Sep 30, 2018 — forked from susnmos/
A script for cycript
(function(exports) {
// 打印按钮的action及其target
zxactionWithTargets = function actionWithTargets(button) {
var allTargets = [button allTargets].allObjects();
if (!allTargets) {
return "is not a uicontrol"
var allShow = [];
for (var i = 0; i < allTargets.length; i++) {
var target = allTargets[i];
bumaociyuan / UIImage+gif.swift
Created May 4, 2018
Get first frame of gif
View UIImage+gif.swift
extension UIImage {
// first frame of gif
class func firstFrame(gif url: URL) -> UIImage? {
guard let data = try? Data(contentsOf: url) as CFData else {
return nil
guard let source = CGImageSourceCreateWithData(data, nil) else {
return nil
guard let cgimage = CGImageSourceCreateImageAtIndex(source, 0, nil) else {
View NSObject+hook.m
@interface NSObject (hook)
+ (void)switchClassFuction:(NSString *)originalSelectorName swizzledSelector:(NSString *)swizzledSelectorName;
+ (void)switchInstanceFuction:(NSString *)originalSelectorName sel2:(NSString *)swizzledSelectorName;
@implementation NSObject (hook)
+ (void)switchClassFuction:(NSString *)originalSelectorName swizzledSelector:(NSString *)swizzledSelectorName {
Class class = object_getClass((id)self);
SEL originalSelector = NSSelectorFromString(originalSelectorName);
bumaociyuan / Podfile
Created Jun 29, 2017
单独配置podfile macro
View Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'demo' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
post_install do |installer|
installer.pods_project.targets.each do |target|
bumaociyuan / zhihu-fuli.js
Last active Jun 25, 2017
View zhihu-fuli.js
(function() {
var imageUrls = [],
totals = 0,
offset = 0,
qId = location.href.split('/').pop();
$(".App-main").innerHTML = '';
var style = " background: rgba(0,0,0,0.8); display: -webkit-flex; /* Safari */ -webkit-flex-wrap: wrap; /* Safari 6.1+ */ display: flex; flex-wrap: wrap; "
$("body").insertAdjacentHTML('beforeend', '<div id="img-fuli" style="' + style + '"><h1 style="color:#fff;">加载中,请稍后...</h1></div>');
View getAllUrlParams.js
function getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] :;
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
bumaociyuan / hehe.swift
Last active Apr 27, 2017
ios 听筒和扬声器切换
View hehe.swift
let session = AVAudioSession.sharedInstance()
try? session.setActive(true)
if !isSpeakerMode {
// NSLog(@"Device is close to user");
do {
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord)
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.none)
} catch _ {}
} else {
// NSLog(@"Device is not close to user");
bumaociyuan / 拼图.bat
Last active Jul 24, 2019
需要 把拼图.bat 放到 C:\Users\zx\AppData\Roaming\Microsoft\Windows\SendTo\ 里面就可以用右键 发送到 拼图.bat 调用脚本
View 拼图.bat
@echo off
title Concat images vertically
echo Begin
set datetimef=%date:~0,2%-%date:~3,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%
echo %datetimef%
setlocal enabledelayedexpansion
set argCount=0
bumaociyuan / info.plist
Last active Aug 30, 2016
Copy the content and paste into info.plist
View info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
bumaociyuan /
Created Jul 28, 2016 — forked from cromandini/
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
# make sure the output directory exists
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
You can’t perform that action at this time.