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
| YU2NJ-JVGKY-44N8R-H8Q5Y-0PGE3 3YT81-KJMJR-04WHY-KMU72-KLNEE |
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: utf-8 | |
| # different instance_exec whit class_exec | |
| class O | |
| def self.haha | |
| puts 'haha' | |
| end | |
| end | |
| O.instance_exec { |
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
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| [webView setBackgroundColor:[UIColor clearColor]]; | |
| [self hideGradientBackground:webView]; | |
| [webView loadHTMLString:@"This is a completely transparent UIWebView. Notice the missing gradient at the top and bottom as you scroll up and down." baseURL:nil]; | |
| } |
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
| /* Original source code courtesy John from iOSDeveloperTips.com */ | |
| #include <sys/socket.h> | |
| #include <sys/sysctl.h> | |
| #include <net/if.h> | |
| #include <net/if_dl.h> | |
| - (NSString *)getMacAddress | |
| { | |
| int mgmtInfoBase[6]; |
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
| var http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 8888; | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname | |
| , filename = path.join(process.cwd(), uri); |
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
| source 'http://ruby.taobao.org' | |
| gem 'rails', '3.2.3' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'sqlite3', '1.3.5' | |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Bootstrap, from Twitter</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta name="description" content=""> | |
| <meta name="author" content=""> |
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
| //系统 | |
| NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; | |
| NSString* version = [infoDict objectForKey:@"CFBundleVersion"]; | |
| //写入 | |
| NSMutableDictionary* dict = [ [ NSMutableDictionary alloc ] initWithContentsOfFile:@"/Sample.plist" ]; | |
| [ dict setObject:@"Yes" forKey:@"RestartSpringBoard" ]; | |
| [ dict writeToFile:@"/Sample.plist" atomically:YES ]; | |
| //读取 |
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 'spec_helper' | |
| describe User do | |
| subject {@user} | |
| before {@user = User.new(name:'ExampleUser', email:'[email protected]', | |
| password: 'foobar', password_confirmation:'foobar') } | |
| it {should be_valid} | |
| it {should respond_to(:name)} | |
| it {should respond_to(:email)} |
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 'spec_helper' | |
| describe "AuthenticationPages" do | |
| subject {page} | |
| describe "login" do | |
| before {visit login_path} | |
| describe "visit login page" do | |
| it{should have_selector('h1', text:'login')} | |
| end |
OlderNewer