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 |
View cd.applescript
tell application "Finder" | |
set pathList to (quoted form of POSIX path of (folder of the front window as alias)) | |
set command to "clear; cd " & pathList | |
end tell | |
tell application "System Events" | |
-- some versions might identify as "iTerm2" instead of "iTerm" | |
set isRunning to (exists (processes where name is "iTerm")) or (exists (processes where name is "iTerm2")) | |
end tell | |
View common.cy
(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]; |
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 shadow.sh
#!/bin/sh | |
# | |
echo '' | |
echo '/*教程请参考:极路由Shadowsocks家庭无痛翻墙实践*/' | |
echo 'https://luolei.org/hiwifi-shadowsocks/' | |
echo 'by @foru17' | |
echo '' | |
echo '' | |
echo '那一天,' | |
echo '人类终于回想起了,' |
View NSObject+hook.m
@interface NSObject (hook) | |
+ (void)switchClassFuction:(NSString *)originalSelectorName swizzledSelector:(NSString *)swizzledSelectorName; | |
+ (void)switchInstanceFuction:(NSString *)originalSelectorName sel2:(NSString *)swizzledSelectorName; | |
@end | |
@implementation NSObject (hook) | |
+ (void)switchClassFuction:(NSString *)originalSelectorName swizzledSelector:(NSString *)swizzledSelectorName { | |
Class class = object_getClass((id)self); | |
SEL originalSelector = NSSelectorFromString(originalSelectorName); |
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 | |
use_frameworks! | |
end | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| |
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>'); | |
loadImg(); |
NewerOlder