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 gulp = require('gulp'); | |
| var shell = require('gulp-shell'); | |
| var preprocess = require('gulp-preprocess'); | |
| var template = require('gulp-template'); | |
| var os = require('os'); | |
| var _ = require('underscore'); | |
| //var replace = require('gulp-replace'); | |
| //var inject = require('gulp-inject'); | |
| gulp.task('redis', shell.task('redis-server > /dev/null &')) |
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
| async.waterfall([ | |
| function (cb) { | |
| app.service.pay(this.data, { | |
| headers: { | |
| "Session-Id": app.sessionId | |
| }, | |
| success: function (data, textStatus, jqXHR) { | |
| console.log('pay resp textStatus:' + textStatus); | |
| console.log('pay resp data', data); | |
| cb(null, data); |
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 Main() | |
| { | |
| IRecord record = new Record1(); | |
| Console.WriteLine (record.Get<int>("aaa")); | |
| } | |
| public interface IRecord { | |
| string GetString(string field); | |
| int GetInt(string field); | |
| long GetLong(string field); |
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
| /*==== calendar ==== */ | |
| .calendar_box {width:1168px;margin-bottom:20px;zoom:1;} | |
| .calendar_box table {position:relative;float:left;width:554px;margin:0 30px 5px 0;overflow:hidden;zoom:1 ;} | |
| .calendar_box caption {font:20px/42px "microsoft yahei";color:#24747b;} | |
| .calendar_box caption a {display:block;height:42px;zoom:1;color:#24747b;} | |
| .calendar_box table caption .pre,.calendar_box table caption .next {float:left;*display:inline;margin-right:-34px;width:34px;font:bold 26px/42px simsun;text-align:center;} | |
| .calendar_box table caption .next {float:right;margin:0 0 0 -34px;} | |
| .calendar_box table caption a:hover {background-color:#32c6c6;color:#fff;text-decoration:none;} | |
| .calendar_box thead {border:1px solid #eee;} | |
| .calendar_box th {width:78px;font:14px/34px "microsoft yahei";color:#999;} |
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 autoSetFrameHeight(name) { | |
| try { | |
| var iframe; | |
| if (!name) return; | |
| iframe = document.getElementById(name); | |
| if (iframe.contentDocument) | |
| $("#" + name).height(iframe.contentDocument.height + "px"); | |
| else | |
| $("#" + name).height(document.frames[name].document.body.scrollHeight + "px"); | |
| } catch (e) { |
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
| using System; | |
| using System.Collections.Concurrent; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace BufferingWorker | |
| { | |
| public class AsyncActionManager<TActionParam> where TActionParam : class | |
| { | |
| private BlockingCollection<ActionBag<TActionParam>> _q1 = new BlockingCollection<ActionBag<TActionParam>>(5000); |
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
| public static class CheckBoxExtensions | |
| { | |
| public static MvcHtmlString CheckBoxFor<TModel>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, int>> expression, int value) | |
| { | |
| if (expression == null) | |
| { | |
| throw new ArgumentNullException("expression"); | |
| } | |
| ModelMetadata modelMetadata = ModelMetadata.FromLambdaExpression<TModel, int>(expression, htmlHelper.ViewData); | |
| string modelName = ExpressionHelper.GetExpressionText(expression); |
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
| internal override IQueryable<Entity.ProductWrapper> AllWrapperedProducts() | |
| { | |
| DateTime today = DateTime.Now.Date; | |
| var query = (from p in ProductDbContext.Product | |
| where p.ResourceType == (int)ProductResourceType.产品 | |
| && p.PkgId.HasValue && p.PkgId.Value != 0 | |
| && p.ExpireDate.HasValue | |
| && p.EffectDate.HasValue | |
| && p.IsValid.HasValue && p.IsValid.Value |
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 Main() | |
| { | |
| string [] phones = { "18616386880", "18621168732" }; | |
| Foo foo = new Foo(phones); | |
| Console.WriteLine(foo.Phones[0]); | |
| phones[0] = "xxx"; | |
| Console.WriteLine(foo.Phones[0]); | |