02 2014 档案
摘要:-copy, as implemented by mutable Cocoa classes, alwaysreturns their immutable counterparts. Thus, when an NSMutableArray is sent -copy, it returns an NSArray containing the same objects.一些参考:http://stackoverflow.com/questions/9859719/objective-c-declared-property-attributes-nonatomic-copy-strong-wea
阅读全文
摘要:最近诸事不顺,今天更新/安装nodejs各种包也全都卡在各个环节,用ie设了全局代理貌似也没什么改观,于是到网上找找有没有国内镜像站,倒是发现了cnpmjs.org这个网站被推荐比较多,看他们主页,他们并不志在提供国内镜像,而是一个Private npm registry and web for Enterprise,反正我换成它后,至少是没碰到卡着不动的问题了,方法参见这篇文章。
阅读全文
摘要:angular 1.2以后(或更早?)移除了ng-bind-html-unsafe,那么我要用这个directive来绑定html代码怎么办?随便一测试,它是不支持把html直接传给它的: //html //js $scope.m="text"; //error: [$sce:unsafe] Attempting to use an unsafe value in ...
阅读全文
摘要:之前不小心看到EF的code first在appharbor上进行migration的时候比较麻烦,今天碰巧也要更新数据库了,顺便试试。modify modelpublic class SiteInfo : Entity{ [JsonProperty("id")] public string UserId { get; set; } [JsonProperty("sitename")] public string SiteName { get; set; } [JsonProperty("socialid")] public stri
阅读全文
摘要:参考:Preventing Cross-Site Request Forgery (CSRF) AttacksValidating .NET MVC 4 anti forgery tokens in ajax requests 在mvc中,微软提供了一个简单的方法来防止CSRF,就是在前端form表单里加上Anti-Forgery Tokens razor的写法很简单:@using (Html.BeginForm("Manage", "Account")) { @Html.AntiForgeryToken()}后端只需要在action上加上[Valida
阅读全文
摘要:基础知识,可由此衍生。原文:http://uniapple.net/blog/?p=2050 In this post, I will show you how to upload a file using Ajax (Asynchronous JavaScript and XML) and receive the binary data in Asp.net C#. And it is ult...
阅读全文
摘要:远端删除文件而不影响本地文件git rm [-r]--cached file_or_dir_name利用.gitignore来自动删除所有匹配文件我试过网上推荐的写法git rm --cached git ls-files -i --exclude-from=.gitignore gitcommit -m 'Removed all files that are in the .gitignore'git push origin master --exclude-from=.gitignore顺便可以简写成-X .gitignore,所以是这样:git rm --cached g
阅读全文
摘要:企业内部的包需要通过nuget来管理发布,或者一些不允许上外网的企业,通过自己的nuget服务器来使用nuget,都会考虑到自建一个nuget服务器。本文整理了一些有用的链接和使用心得,以备不时之需。教程NuGet.Server的简单教程官方文档, 注意以下几节即可:Creating and Publishing a PackageConfiguration File and Source Code TransformationsNuspec Reference笔记简单来说,就是创建一个配置文件给msbuild来读取,以生成打包文件(*.nupkg)至于怎么生成,第一个教程已经给出了三种方式(
阅读全文