This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, maximum=1.0, minimum-scale=1.0"> | |
<!-- width:可設定數值,或者指定為 device-width | |
height:可設定數值,或者指定為 device-height | |
initial-scale:第一次進入頁面的初始比例 | |
minimum-scale:允許縮小最小比例 | |
maximum-scale:允許放大最大比例 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
no need to copy this section. | |
ussge: | |
in CustomClass.h | |
+(instancetype)sharedManager; | |
in CustomClss.m | |
@implementation CustomClass | |
... | |
SYNTHESIZE_SINGLETON_FOR_CLASS(CustomClass) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- northwind for postgreSQl.. tell me if it works :p | |
-- | |
-- PostgreSQL Northwind Database v1.0 from Ramiro Estigarribia Canese | |
-- you may contact him at email ramiro.estigarribia@rieder.com.py | |
-- | |
SET statement_timeout = 0; | |
SET client_encoding = 'UTF8'; | |
SET standard_conforming_strings = on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 固定用的一些 macro 方法,不牵涉 app 变数定义 | |
// 取角度, convert radius to angle | |
#define degreesToRadian(x) (M_PI * (x) / 180.0) | |
//取螢幕尺寸, screen resolution | |
#define kScreenWidth [[UIScreen mainScreen] bounds].size.width | |
#define kScreenHeight [[UIScreen mainScreen] bounds].size.height | |
//判斷是否 iPhone 5, this may need change after iphone6.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from http://stackoverflow.com/questions/11726543/how-to-turn-flashlight-on-off-using-one-button | |
AVCaptureDevice *flashLight = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | |
if ([flashLight isTorchAvailable] && [flashLight isTorchModeSupported:AVCaptureTorchModeOn]) | |
{ | |
BOOL success = [flashLight lockForConfiguration:nil]; | |
if (success) | |
{ | |
if ([flashLight isTorchActive]) { | |
[flashLight setTorchMode:AVCaptureTorchModeOff]; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################### | |
# https://gist.github.com/adamgit/3786883 | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# Version 2.0 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# | |
# 2013 updates: | |
# - fixed the broken "save personal Schemes" | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (BOOL)isJailbroken { | |
FILE *f = fopen("/bin/bash", "r"); | |
BOOL isJailbroken = NO; | |
if (f != NULL) | |
// Device is jailbroken | |
isJailbroken = YES; | |
else | |
// Device isn't jailbroken | |
isJailbroken = NO; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://www.objc.io/issue-13/behaviors.html | |
behavior instance basic | |
*/ | |
@interface KZBehavior : UIControl | |
//! object that this controller life will be bound to | |
@property(nonatomic, weak) IBOutlet id owner; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import git | |
from git import Repo | |
from time import gmtime, strftime | |
import time | |
# 這是用來 | |
# 1. 讓 MCS, EC 端檢查檔案是否有更新,有更新則提交 | |
# 2. 讓本地 repo 進行檢查,然後push到 bit 上 |
OlderNewer