Skip to content

Instantly share code, notes, and snippets.

View Grisson's full-sized avatar

Grisson Wang Grisson

View GitHub Profile
@Grisson
Grisson / PassThroughView.swift
Created April 27, 2017 18:06 — forked from kutschenator/PassThroughView.swift
Implementation of PassThroughView in Swift
import Foundation
import UIKit
class PassThroughView: UIView {
override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool {
for subview in subviews as [UIView] {
if !subview.hidden && subview.alpha > 0 && subview.userInteractionEnabled && subview.pointInside(convertPoint(point, toView: subview), withEvent: event) {
return true
}
}
@Grisson
Grisson / ocmock-cheatsheet.m
Created April 17, 2017 17:26 — forked from kharmabum/ocmock-cheatsheet.m
OCMock cheatsheet
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
@Grisson
Grisson / reindex.py
Last active January 5, 2016 18:57 — forked from bracki/reindex.py
Simple reindex for elasticsearch using pyes
import pyes
conn = pyes.es.ES("localhost:9200")
all = conn.search(pyes.query.MatchAllQuery(), 'index', 'type', scan=True)
for a in all:
conn.index(a, 'index', 'type', a.get_id(), bulk=True)