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
| $(function () { | |
| "use strict"; | |
| // for better performance - to avoid searching in DOM | |
| var content = $('#content'); | |
| var input = $('#input'); | |
| var status = $('#status'); | |
| // my color assigned by the server | |
| var myColor = false; |
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 request = require('request'), default_headers, site_root = 'http://localhost:3000';; | |
| default_headers = { | |
| 'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1', | |
| 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', | |
| 'Accept-Language': 'en-us,en;q=0.5', | |
| 'Accept-Encoding': 'gzip, deflate', | |
| 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', | |
| // 'Connection': 'keep-alive', | |
| 'Cache-Control': 'max-age=0' |
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
| #!/usr/bin/sh | |
| rm -rf "$HOME/Library/Preferences/WebIde40" | |
| rm -rf "$HOME/Library/Caches/WebIde40" | |
| rm -rf "$HOME/Library/Application Support/WebIde40" | |
| rm -rf "$HOME/Library/Logs/WebIde40" |
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 *params = [NSDictionary dictionaryWithObjectsAndKeys: | |
| height, @"user[height]", | |
| weight, @"user[weight]", | |
| nil]; | |
| AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL: | |
| [NSURL URLWithString:@"http://localhost:8080/"]]; | |
| [client postPath:@"/mypage.php" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
| NSString *text = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; |
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
| """ | |
| http://saepy.sinaapp.com/topic/24/Tornado%E4%B8%8A%E4%BC%A0%E6%96%87%E4%BB%B6%E7%A4%BA%E4%BE%8B | |
| 在bcore的开发过程中,涉及到上传文件有两个地方,一个是相册,一个是文章图文混排。这里作为一个备忘。罗列一些关键点: | |
| 文件上传的内容体在tornado.web.RequestHandler.request.files属性中,并且是以数组形式存放的。 | |
| 使用临时文件存储时,在write完成后要记着把seek重置到文件头。要不然文件无法被读取。 | |
| 再使用Image模块的thumbnail方法进行缩放时,resample=1作为重载渲染参数能够有效的使图片平滑,消除锯齿。 |
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
| """ | |
| tornado_static is a module for displaying static resources in a Tornado web | |
| application. | |
| It can take care of merging, compressing and giving URLs ideal renamings | |
| suitable for aggressive HTTP caching. | |
| (c) mail@peterbe.com | |
| """ |
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
| // Module dependencies | |
| var express = require('express'), | |
| mysql = require('mysql'); | |
| // Application initialization | |
| var connection = mysql.createConnection({ | |
| host : 'localhost', | |
| user : 'root', |
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
| // | |
| // CommonMacro.h | |
| // | |
| // | |
| // Created by Haven on 26/9/13. | |
| // Copyright (c) 2013 LF. All rights reserved. | |
| // | |
| #import <CoreTelephony/CTTelephonyNetworkInfo.h> | |
| #import <CoreTelephony/CTCarrier.h> |
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
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 16px; | |
| line-height: 1.6; | |
| padding: 10px; | |
| background-color: white; | |
| } | |
| body > *:first-child { | |
| margin-top: 0 !important; |