Skip to content

Instantly share code, notes, and snippets.

View lbj96347's full-sized avatar

lbjhk lbj96347

View GitHub Profile
@lbj96347
lbj96347 / Objective-C_zip_Function.m
Last active December 9, 2015 20:58
Objective-C zip 函数 用于二维数组重排
/** * 把一个二维数组做坐标转换。例;
原数组:
arry = [[a, b, c],
[e, f, g]
]
@lbj96347
lbj96347 / TouchEffectProxy.html
Created October 30, 2012 18:32
Touch Effect Proxy
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for Web App Setup -->
<!-- Author : @CashLee李秉骏 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name='description' content='' >
<meta name='author' content='' >
@lbj96347
lbj96347 / OpenANativeAppInWebApp.html
Created October 30, 2012 15:32
Open a native app in Web App
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for Web App Setup -->
<!-- Author : @CashLee李秉骏 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Web App icon -->
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@lbj96347
lbj96347 / PHPUserAgentDirection.php
Created October 18, 2012 06:02
PHP User Agent Direction
<?php
$agent;
function is_mobile(){
//正则表达式,批配不同手机浏览器UA关键词。
$regex_match="/(nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|";
$regex_match.="htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|";
$regex_match.="blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|";
$regex_match.="symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|";
$regex_match.="jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220";
$regex_match.=")/i";
@lbj96347
lbj96347 / PhongepKeyboardAutohide
Created September 11, 2012 05:08
Phonegap Keyboard Auto Hide
/* This file concludes native code and javascript code and u just need to paste native code into your phonegap plugin */
/* native code part */
/* keyboard auto hide solution */
- (void) hideKeyboard:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
//UIButton *button = [UIButton
buttonWithType:UIButtonTypeRoundedRect;
NSLog(@"hideKeyboard is being called");
@lbj96347
lbj96347 / JsBase64.html
Created September 1, 2012 05:51
javascript_base64
<!DOCTYPE html>
<html>
<head>
<title>base64 Encoding/Decoding</title>
</head>
<script type="text/javascript">
var keyStr = "ABCDEFGHIJKLMNOP" +
"QRSTUVWXYZabcdef" +
@lbj96347
lbj96347 / Phonegap_AppDelegate.m
Created August 14, 2012 09:09
Phonegap_AppDelegate_Config
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@lbj96347
lbj96347 / WebAppTouchBlink.html
Created August 5, 2012 11:45
Web App Touch Blink
@lbj96347
lbj96347 / sha1_javascript_library.js
Created July 11, 2012 09:58
sha1_javascript_library
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS PUB 180-1
* Version 2.1-BETA Copyright Paul Johnston 2000 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
@lbj96347
lbj96347 / tencent_weibo_post_pic_t.php
Created July 4, 2012 05:24
tencent weibo pic & t share
<?php
//腾讯微博,分享微博加图片
if($url){
//$ext=substr($url, -3,3);
$ext=strrchr($url,".");
//查找'.'字符串出现的位置
$filename=date("YMDHis").$ext;
//定义文件名字为日期+网址
$exName = strtolower(substr($filename,(strrpos($filename,'.')+1)));
//文件名字,去掉文件格式