ブロック使うAPIだった。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define Left NSLayoutAttributeLeft | |
#define Right NSLayoutAttributeRight | |
#define Top NSLayoutAttributeTop | |
#define Bottom NSLayoutAttributeBottom | |
#define Leading NSLayoutAttributeLeading | |
#define Trailing NSLayoutAttributeTrailing | |
#define Width NSLayoutAttributeWidth | |
#define Height NSLayoutAttributeHeight | |
#define CenterX NSLayoutAttributeCenterX | |
#define CenterY NSLayoutAttributeCenterY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Customise Safari Web Inspector font*/ | |
/*(tested on Safari 7.0.1 on OS X Mavericks)*/ | |
/*NO WARRANTY IMPLIED - Will work until Safari is updated requiring a re-patch*/ | |
/*INSTRUCTIONS*/ | |
1. Quit Safari | |
2. In Finder go to the following folder: /System/Library/PrivateFrameworks | |
3. Copy the following framework to your Desktop: WebInspectorUI.framework | |
4. Rename the original framework to avoid overwriting - I append .orig to the filename - authenticate if necessary | |
5. Open Terminal and enter the following command: chmod 777 ~/Desktop/WebInspectorUI.framework/Versions/A/Resources/Main.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func p_setupTextLayer(text: String) -> CAShapeLayer { | |
var letters = CGPathCreateMutable() | |
let font = CTFontCreateWithName("Helvetica-Bold", 72, nil) | |
let attrs = [kCTFontAttributeName: font] | |
var attrString = NSAttributedString(string: text, attributes: attrs) | |
let line = CTLineCreateWithAttributedString(attrString) | |
let runArray = CTLineGetGlyphRuns(line) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Note to self: | |
This UITextView class extension gets calles every time iOS wants to add a new gesture recognizer to the textView. | |
It checks for the type of the gesture recognizer (Long Press) and then for the associated action. | |
Only if the action is ``smallDelayRecognizer:``, the gestuere recognizer will stay enabled. | |
All otheer long press gestures will be disabled. | |
Purpose: | |
Allow user interaction with the links in the attributedText, but disallow text selection | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在hass中用Google Home语音控制小米扫地机器人 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################### | |
# FROM MAIN COMPUTER | |
#################### | |
# Create the sync directory in Dropbox | |
$ mkdir ~/Dropbox/sublime-text-3 | |
# Move your ST3 "Packages" and "Installed Packages" to Dropbox | |
$ cd ~/Library/Application\ Support/Sublime\ Text\ 3 | |
$ mv Packages/ ~/Dropbox/sublime-text-3 | |
$ mv Installed\ Packages/ ~/Dropbox/sublime-text-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sass Snippets | |
snippet @i | |
@import "${1}"; | |
snippet ext | |
@extend ${1}; | |
snippet inc | |
@include ${1}(${2});${3} | |
snippet @m | |
@media ${1} { | |
${2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GLOBAL CONFIGURATIONS | |
# ------------------------------------------------------------------- | |
# See https://github.com/jigish/slate/wiki/Global-Configs | |
config defaultToCurrentScreen true | |
config secondsBeforeRepeat 0.4 | |
config secondsBetweenRepeat 0.1 | |
config keyboardLayout "qwerty" | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
OlderNewer