This file contains hidden or 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
| "" encoding | |
| set encoding=utf-8 | |
| set termencoding=utf-8 | |
| set fileencoding=utf-8 | |
| set fileencodings=utf-8,cp932,iso-2022-jp,euc-jp,ucs2le,ucs-2 | |
| "" basic settings | |
| set wrap | |
| set wrapscan | |
| set hlsearch |
This file contains hidden or 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
| <?php | |
| App::uses('File', 'Utility'); | |
| App::uses('Folder', 'Utility'); | |
| class SeedShell extends AppShell { | |
| public function startup() { | |
| $this->_welcome(); | |
| $this->out('Cake Seed Shell'); | |
| $this->hr(); |
This file contains hidden or 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
| <?php | |
| App::uses('Component', 'Controller'); | |
| App::import('Vendor', 'ApnsPHP/Autoload'); | |
| class ApnsComponent extends Component { | |
| public $env; | |
| public $app_cert_path; | |
| public $entrust_cert_path; | |
| public $identifier = 'CakeApns'; | |
| public $expiry = 30; |
This file contains hidden or 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
| # Thanks to https://github.com/github/gitignore | |
| # for CakePHP | |
| tmp/* | |
| config/database.php | |
| app/tmp/* | |
| app/config/database.php | |
| !empty | |
| # for Emacs |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>application-identifier</key> | |
| <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string> | |
| <key>keychain-access-groups</key> | |
| <array> | |
| <string>$(AppIdentifierPrefix)yourAccessGroup</string> | |
| </array> |
This file contains hidden or 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
| // in (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| if([[UINavigationBar class] respondsToSelector:@selector(appearance)]) { | |
| [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar.png"] forBarMetrics:UIBarMetricsDefault]; | |
| NSDictionary *titleTextAttr = [NSDictionary dictionaryWithObjectsAndKeys: | |
| [UIColor colorWithWhite:0.21f alpha:1.f], UITextAttributeTextColor, | |
| [UIColor whiteColor], UITextAttributeTextShadowColor, | |
| nil]; | |
| [[UINavigationBar appearance] setTitleTextAttributes:titleTextAttr]; | |
| } |
This file contains hidden or 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
| define(['jquery'], function($) { // do NOT add jquerymobile in deps array. | |
| $(document).on("pageinit", "#alpha", function() { // #alpha => the id attr of div[data-role="page"] | |
| // your scripts... | |
| }); | |
| }); |
This file contains hidden or 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
| require 'io/console' | |
| require 'pty' | |
| PTY::getpty("sh") do |r,w| | |
| Thread.new do | |
| loop do | |
| w.write IO.console.getch | |
| end | |
| end | |
| loop do |
This file contains hidden or 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
| #ifdef DEBUG | |
| #define Logger(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
| #else | |
| #define Logger(...) | |
| #endif |
This file contains hidden or 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
| # coding: utf-8 | |
| $arr = [43,145,35,32,565,5,76,43,2,5,66,332,44,42,34,42,43,23,4,24,542,1,1,34,23] | |
| p "arr:" | |
| p $arr | |
| def calc(mini, maxi) | |
| ai = mini | |
| bi = maxi |