Skip to content

Instantly share code, notes, and snippets.

@IBAction func moveBlock(sender: AnyObject) {
UIView.animateWithDuration(3, animations: { () -> Void in
self.viewToAnimate.frame = .zero
}) { (success) -> Void in
}
}
@IBAction func stop(sender: AnyObject) {
if viewToAnimate.layer.speed == 0 {
resumeLayer(viewToAnimate.layer)
@bumaociyuan
bumaociyuan / demo.swift
Last active June 27, 2016 09:10
blur present viewcontroller
let vc = CustomViewController()
vc.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve
vc.modalPresentationStyle = UIModalPresentationStyle.OverFullScreen
presentViewController(vc, animated: true, completion: nil)
// in CustomViewController
override func viewDidLoad() {
super.viewDidLoad()
let lightEffect = UIBlurEffect(style: .Light)
let lightView = UIVisualEffectView(effect: lightEffect)
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
},
"settings": {
"ecmascript": 6,
"jsx": true
},
@bumaociyuan
bumaociyuan / info.plist
Last active August 30, 2016 02:50
Copy the content and paste into info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</plist>
@bumaociyuan
bumaociyuan / shadow.sh
Created February 18, 2016 01:58
极路由安装ss
#!/bin/sh
#
echo ''
echo '/*教程请参考:极路由Shadowsocks家庭无痛翻墙实践*/'
echo 'https://luolei.org/hiwifi-shadowsocks/'
echo 'by @foru17'
echo ''
echo ''
echo '那一天,'
echo '人类终于回想起了,'
@bumaociyuan
bumaociyuan / universal-framework.sh
Created July 28, 2016 09:37 — forked from cromandini/universal-framework.sh
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).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# 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
@bumaociyuan
bumaociyuan / pre-commit.sh
Created June 20, 2016 07:38
swiftlint 的pre-commit 脚本, 自动在commit之前格式化代码
#!/bin/bash
# 这是一个pre-commit 的脚本
# Run SwiftLint
START_DATE=$(date +"%s")
echo $START_DATE
SWIFT_LINT=/usr/local/bin/swiftlint
function getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
@bumaociyuan
bumaociyuan / gist.md
Last active June 4, 2017 11:31
Stuck on `Authenticating with the App Store...`
@bumaociyuan
bumaociyuan / zhihu-fuli.js
Last active June 25, 2017 08:06
知乎图片浏览
(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();