Put flip
somewhere in your $PATH
and chmod a+x
it.
Copy fuck
into ~/.bashrc
.
// XCode 4.2.1 | |
@implementation NSString(EmojiExtension) | |
- (NSString*)removeEmoji { | |
__block NSMutableString* temp = [NSMutableString string]; | |
[self enumerateSubstringsInRange: NSMakeRange(0, [self length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock: | |
^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop){ |
#!/bin/sh | |
# 1.切换到工程目录 | |
# 2.用gource-gravatar-getter将头像下载到.git/avatar,格式类似 .git/avatar/mckelvin.png | |
# | |
gource --seconds-per-day 0.6 \ | |
--user-image-dir .git/avatar \ | |
--multi-sampling -1360x760 \ | |
--output-ppm-stream /tmp/vis_tmp.ppm \ | |
--disable-progress \ | |
--hide mouse \ |
height: 650 | |
license: mit |
// Code to handle up/down cursor motion in a UITextView. | |
// | |
// Based on code from OmniGroup's OUITextView | |
// https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniUI/iPad/OUITextView.m | |
// | |
#import "TextView.h" | |
@interface TextView () | |
for (UIView *subview in searchBar.subviews) { | |
for (UIView *subSubview in subview.subviews) { | |
if ([subSubview conformsToProtocol:@protocol(UITextInputTraits)]) { | |
UIView<UITextInputTraits> *textInputField = (UIView<UITextInputTraits> *)subSubview; | |
textInputField.returnKeyType = UIReturnKeyDone; | |
break; | |
} | |
} | |
} |
"""A simple implementation of a greedy transition-based parser. Released under BSD license.""" | |
from os import path | |
import os | |
import sys | |
from collections import defaultdict | |
import random | |
import time | |
import pickle | |
SHIFT = 0; RIGHT = 1; LEFT = 2; |
Simplify[RSolve[{a[n] == (B + 1) a[n - 1] - a[n - 2], a[0] == 0, a[1] == B}, a[n], n]] | |
Block[{B = 2}, Simplify[Table[a[n] /. First[%], {n, 10}]]] |
@implementation CIContext (IntermediateImage) | |
- (CIImage *)rsq_renderToIntermediateImage:(CIImage *)image { | |
CIImage *intermediateImage = nil; | |
CGSize size = image.extent.size; | |
CVPixelBufferRef pixelBuffer = NULL; | |
CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, | |
size.width, | |
size.height, | |
kCVPixelFormatType_32ARGB, |
In this article, I'm going to explore a way that we can create views that implement custom Core Animation property animations in a natural way.
As we know, layers in iOS come in two flavours: Backing layers and hosted layers. The only difference between them is that the view acts as the layer delegate for its backing layer, but not for any hosted sublayers.
In order to implement the UIView
transactional animation blocks, UIView
disables all animations by default and then re-enables them individually as required. It does this using the actionForLayer:forKey:
method.
Somewhat strangely, UIView
doesn't enable animations for every property that CALayer
does by default. A notable example is the layer.contents
property, which is animatable by default for a hosted layer, but cannot be animated using a UIView
animation block.