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
# 1. add Sublime Text 3 to terminal | |
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl | |
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 partial class PdfController : LocalDefaultController | |
{ | |
public void GeneratePdfFromUrl() | |
{ | |
// Option 1: save pdf file as... | |
var options = new HtmlToPdfOptions(); | |
HttpCookieCollection oCookies = Request.Cookies; | |
for (int j = 0; j < oCookies.Count - 1; j++) |
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 (ZipFile zipDest = ZipFile.Read(bdocPath)) | |
{ | |
zipDest.AddFiles(files, false, string.Empty); | |
zipDest.Save(); | |
} |
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.Drawing; | |
using System.Net.Mail; | |
using System.Web; | |
using EO.Pdf; | |
using System.IO; | |
using System.Net; | |
namespace KopioNiini.ProjectBank.UI.Controllers | |
{ |
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
services.AddMvc().Configure<MvcOptions>(options => | |
{ | |
options.OutputFormatters | |
.Where(f => f.Instance is JsonOutputFormatter) | |
.Select(f => f.Instance as JsonOutputFormatter) | |
.First() | |
.SerializerSettings | |
.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
}); |
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
// Konverdib partial Razor view to string | |
public string RenderRazorViewToString(string viewName, object model) | |
{ | |
ViewData.Model = model; | |
using (var sw = new StringWriter()) | |
{ | |
var viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName); | |
var viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw); | |
viewResult.View.Render(viewContext, sw); |
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
describe("jsTests:", function () { | |
var $scope, $controller, $httpBackend, $injector; | |
var myService; | |
beforeEach(function () { | |
module("kn"); | |
}); | |
beforeEach(function () { | |
this.addMatchers({ |
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
(dir -include *.cs,*.fx -recurse | select-string .).Count |
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
<form id="form1" runat="server"> | |
<input type='file' id="imgInp" /> | |
<img id="blah" src="#" alt="your image" /> | |
</form> |
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 class Author : IEquatable<Author> | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public bool Equals(Author other) | |
{ | |
if (FirstName == other.FirstName && LastName == other.LastName) | |
return true; |