Skip to content

Instantly share code, notes, and snippets.

@monjer
monjer / NSObject+GetGlobalObject.h
Last active December 14, 2015 21:08
获取全局对象分类
#import <Foundation/Foundation.h>
@interface NSObject (GetGlobalObject)
@property (nonatomic , weak) UIScreen *mainScreen ;
@property (nonatomic , weak) UIApplication *app ;
@property (nonatomic , weak) UIWindow *keyWindow ;
@monjer
monjer / MJModalOverlayer.h
Last active December 14, 2015 21:19
模拟UIAlertView的模态背景遮罩
//
// MJModalOverlayer.h
// Overlayer
//
// Created by manjun.han on 13-3-13.
// Copyright (c) 2013年 com.hmj. All rights reserved.
//
#import <UIKit/UIKit.h>
//
// UIView+Screenshot.h
//
// Created by manjun.han on 13-3-13.
// Copyright (c) 2013年 com.hmj. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (Screenshot)
@monjer
monjer / Test.html
Last active December 15, 2015 02:29
JS对象命名空间管理器
<!DOCTYPE html">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ns Test</title>
<script src="ns.js"></script>
</head>
<body>
<script>
var appViewReturned = ns.create("app.view");
@monjer
monjer / Page.js
Last active December 15, 2015 02:29
获取HTML页面相关的全局对象和文档位置
/**
* 文档位置相关
* @param {Object} opt_doc
*/
(function(opt_ns , opt_wind){
var g_win = opt_wind || top ;
var g_doc = g_win.document ;
var page = {
@monjer
monjer / lang.js
Last active December 15, 2015 02:29
JS常用快捷方法
(function(opt_ns , opt_wind){
var g_win = opt_wind || top ;
var g_doc = g_win.document ;
var toString = Object.prototype.toString ;
var types = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
var classToType = {};// javascript 类型名称的精简版映射
@monjer
monjer / cookie.js
Last active December 15, 2015 02:29
cookie操作方法
@monjer
monjer / ajax.js
Last active December 15, 2015 02:29
Ajax封装类
(function(opt_ns , opt_wind){
var g_win = opt_wind || top ;
var g_doc = g_win.document ;
var ajax = {
fireEvent : function(xhr , type , handlers , timerId){
var handler = handlers["on"+type];
if(timerId){
@monjer
monjer / UIAlertView+Loading.h
Last active December 15, 2015 05:59
加UIAlertView的网络提示分类
//
// UIAlertView+Loading.h
//
// Created by manjun.han on 13-3-21.
// Copyright (c) 2013年 mj. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIAlertView (Loading)
@monjer
monjer / tool.css
Last active December 16, 2015 06:58
常用工具样式
/********清除浮动塌陷********/
/*
* reference:
* 1.http://nicolasgallagher.com/micro-clearfix-hack/
* 2.http://www.qianduan.net/new-clearfix.html
* 3.http://stackoverflow.com/questions/8554043/what-is-clearfix
*
*/