Skip to content

Instantly share code, notes, and snippets.

View vc7's full-sized avatar
🇹🇼
ミルクティー大好き

Lihsuan Chen vc7

🇹🇼
ミルクティー大好き
View GitHub Profile
@vc7
vc7 / hideStatus.m
Last active December 19, 2015 09:19
Hide status bar in iOS Projects.
[UIApplication sharedApplication].statusBarHidden = YES;
@vc7
vc7 / mapbox_iframe.html
Last active December 19, 2015 11:29
Usage of MapBox in iframe.
<iframe width='500' height='300' frameBorder='0' src='http://a.tiles.mapbox.com/v3/vince78718.map-6z5j80z7.html#5/24.35710549396971/-238.95889680612004'></iframe>
@vc7
vc7 / restrictInput.html
Last active December 19, 2015 11:29
Use regular expression to restrict user's input value.
<input type="text" onkeyup="value=value.replace(/[^-_0-9]/g,'')">
@vc7
vc7 / selectioncolor.less
Created July 11, 2013 02:54
Change selection color by css.
@carrot :#E67E22;
/* Mozilla based browsers */
::-moz-selection {
background-color: @carrot;
}
/* Works in Safari */
::selection {
background-color: @carrot;
typedef enum {
UIViewContentModeScaleToFill,
UIViewContentModeScaleAspectFit,
UIViewContentModeScaleAspectFill,
UIViewContentModeRedraw,
UIViewContentModeCenter,
UIViewContentModeTop,
UIViewContentModeBottom,
UIViewContentModeLeft,
UIViewContentModeRight,
// myUIImageView is an instance of UIImageView
[myUIImageView setContentMode] = UIViewContentModeCenter;
@vc7
vc7 / pagebation_bootstrap_setup.php
Last active December 19, 2015 15:29
Bootstrap has its owned format of pagination, this gist is the configure to make pagination in Codeigniter matching with Bootstrap.
$this->load->library('pagination');
// Config Pagination
$config = array(
'base_url' => base_url(),
'total_rows' => 100,
'per_page' => 10,
'full_tag_open' => '<div class="pagination pagination-centered"><ul>',
'full_tag_close' => '</ul></div>',
'first_link' => $this->lang->line('First'),
// Config Pagination
$pagination = $this->config->config['pagination'];
$pagination['base_url'] = 'the/base/url/you/want/to/use';
$pagination['total_rows'] = 1000;
// 1. Autoload
// In application/config/autoload.php around line 82
$autoload['config'] = array('pagination');
// 2. Manually
$this->load->config('pagination');
// 取得 400*200 的隨機圖片
http://lorempixel.com/200/200
// 在長、寬前加上參數 "g" 可以讓隨機圖片變灰階
http://lorempixel.com/g/200/200