Skip to content

Instantly share code, notes, and snippets.

View Grisson's full-sized avatar

Grisson Wang Grisson

View GitHub Profile
@Grisson
Grisson / begin(C++).md
Created September 28, 2021 16:58 — forked from johnmcfarlane/begin(C++).md
Resources for C++ beginners
@Grisson
Grisson / k8s-pi.md
Created January 2, 2020 02:20 — forked from alexellis/k8s-pi.md
K8s on Raspbian
@Grisson
Grisson / tls-client.go
Created October 10, 2017 05:40 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@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)