Skip to content

Instantly share code, notes, and snippets.

View atom2ueki's full-sized avatar
☮️

Tony Li atom2ueki

☮️
View GitHub Profile
import UIKit
protocol CommonProtocol {
func commonFunc()
}
protocol ProtocolA: CommonProtocol {
func sameName()
}
@atom2ueki
atom2ueki / gist:0f2f8b8ba6f0413f523a324d71a50604
Created May 30, 2019 09:05 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@atom2ueki
atom2ueki / accelerate.m
Last active February 18, 2019 07:20
form an array of sqrt of float numbers from another float array by using accelerate vs forloop way
#import <Foundation/Foundation.h>
#import <Accelerate/Accelerate.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSLog(@"start");
int count = 10000000;
float *x = malloc(count * sizeof(float));
float initial = 0;
float increment = drand48()*count;
@atom2ueki
atom2ueki / ViewController.h
Last active April 12, 2018 08:25
ViewController.h
//
// ViewController.h
// runtime_special_case
//
// Created by tonyli on 4/10/18.
// Copyright © 2018 tonyli. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
import UIKit
// MARK: - UIButton Related
public extension UIButton {
private struct cs_associatedKeys {
static var accpetEventInterval = "cs_acceptEventInterval"
static var acceptEventTime = "cs_acceptEventTime"
}
// 重复点击的间隔
var cs_accpetEventInterval: NSTimeInterval {
get {
@atom2ueki
atom2ueki / create.sh
Created July 5, 2017 07:26
Create a bootable usb for High Sierra Beta
sudo /Applications/Install\ macOS\ High\ Sierra\ Beta.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ High\ Sierra\ Beta.app
@atom2ueki
atom2ueki / multiple-react-drawer-sample.js
Created November 3, 2016 08:10
multiple react-drawer sample
/**
* This is a thrid party component created by Tony Li
*
* all right reserved by @author Tony Li
*
*/
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDrawer from '../src/ReactDrawer';
@atom2ueki
atom2ueki / app.js
Created November 28, 2015 12:56
react-native-router-redux-sample
'use strict';
import React, { Component, StyleSheet } from 'react-native';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux/native';
import {
actions as routerActions,
NavBar,
Route,
Router,