Skip to content

Instantly share code, notes, and snippets.

@fhefh2015
fhefh2015 / new_gist_file.css
Created March 10, 2016 03:51
css box-sizing
.border_box {
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
@fhefh2015
fhefh2015 / new_gist_file
Created March 10, 2016 08:10
how to set focus to textfield
[textfield becomeFirstResponder];
@fhefh2015
fhefh2015 / new_gist_file
Created March 13, 2016 06:08
iOS 获取某个类的全部属性以及方法
//获取类的方法
+ (void)LogAllMethodsFromClass:(id)obj
{
u_int count;
//class_copyMethodList 获取类的所有方法列表
Method *mothList_f = class_copyMethodList([obj class],&count) ;
for (int i = 0; i < count; i++) {
Method temp_f = mothList_f[i];
// method_getImplementation 由Method得到IMP函数指针
@fhefh2015
fhefh2015 / new_gist_file
Last active March 13, 2016 07:12
iOS数据持久化
//
// ViewController.m
// 数据持久化
//
// Created by fhefh on 16/3/13.
// Copyright © 2016年 fhefh. All rights reserved.
//
#import "ViewController.h"
@fhefh2015
fhefh2015 / new_gist_file_0.js
Last active May 17, 2016 06:11
jquery 为动态添加的元素绑定事件
$('someUlSelector').delegate('someLiSelector', 'click', function() {
//codes...
//$(this) for the current jquery instance of the element
});
@fhefh2015
fhefh2015 / gist:aa582d97fe0bc7550e3c
Last active March 17, 2016 01:29 — forked from ethanbing/gist:10970615
iOS 常用数学函数
1、 三角函数 
  double sin (double);正弦 
  double cos (double);余弦 
  double tan (double);正切 
  2 、反三角函数 
  double asin (double); 结果介于[-PI/2, PI/2] 
  double acos (double); 结果介于[0, PI] 
  double atan (double); 反正切(主值), 结果介于[-PI/2, PI/2] 
  double atan2 (double, double); 反正切(整圆值), 结果介于[-PI, PI] 
  3 、双曲三角函数 
@fhefh2015
fhefh2015 / Quartz2D.md
Created March 17, 2016 10:18 — forked from ldong/Quartz2D.md
Quartz 2D

Quartz 2D Notes

  CGContextRef context = ();
    //设置起始点
    CGContextMoveToPoint (context, 160, 100);
    CGContextAddLineToPoint (context, 100, 180);
    CGContextAddLineToPoint (context, 160, 180);
    // 设置边界
    [[UIColor blackColor] setStroke];
@fhefh2015
fhefh2015 / new_gist_file
Last active March 21, 2016 05:58
图片添加水印
//
// ViewController.m
// 图片水印
//
// Created by fhefh on 16/3/21.
// Copyright © 2016年 fhefh. All rights reserved.
//
#import "ViewController.h"
@fhefh2015
fhefh2015 / DataBaseHandler.h
Last active March 25, 2016 02:34
sqlite3简易封装
//
// DataBaseHandler.h
// 代码:http://www.jianshu.com/p/a02479cc5e15
//
#import <Foundation/Foundation.h>
#import <sqlite3.h>
@interface DataBaseHandler : NSObject
{
@fhefh2015
fhefh2015 / new_gist_file
Created March 30, 2016 02:43
屏幕截图
//
// ViewController.m
// 图片截屏
//
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *picView;