Tip to avoid "dirty commits" When you create a new branch, instead of doing
git checkout develop
git checkout -b [branch-name]
do
git checkout -b [branch-name] origin/develop
public static class ExcelPackageExtension | |
{ | |
internal static byte[] HtmlBytes(this ExcelPackage package) | |
{ | |
string html = string.Empty; | |
string headerHtml = string.Empty; | |
string footerHtml = string.Empty; | |
string theadHtml = string.Empty; | |
const string header = "{{header}}"; |
private static HttpResponseMessage HttpReport(byte[] bytes, string fileName) | |
{ | |
HttpResponseMessage httpResponseMessage; | |
using (var stream = new MemoryStream(bytes)) | |
{ | |
httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) | |
{ | |
Content = new ByteArrayContent(stream.ToArray()) | |
}; |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
//Add to Global.asax -- GlobalConfiguration.Configuration.MessageHandlers.Add(new CorsHandler()); | |
namespace Common.Helpers | |
{ | |
public class CorsHandler : DelegatingHandler |
<%@ WebHandler Language="C#" CodeBehind="proxy.ashx.cs" Class="PIPE.Host.proxy" %> |
// JS array equivalents to C# LINQ methods - by Dan B. | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, | |
{ name: "Judy", age: 42 }, | |
{ name: "Tim", age: 8 } |
public interface ICache<out T> | |
{ | |
T Get(string key); | |
} | |
public class CacheObject<T> | |
{ | |
public T Value { get; set; } | |
public DateTime CachedDate { get; set; } |
Tip to avoid "dirty commits" When you create a new branch, instead of doing
git checkout develop
git checkout -b [branch-name]
do
git checkout -b [branch-name] origin/develop
[cmdletbinding(SupportsShouldProcess=$True)] | |
param( | |
# What .tar.gz file should be extracted? Must exist. | |
[Parameter(Mandatory=$True)] | |
[string]$FileToExtract, | |
# What folder should the files be extracted into? Does not need to exist | |
[Parameter(Mandatory=$True)] | |
[string]$TargetFolder, |
[1, 2, 3].map(x => x + 1) | |
> (3) [2, 3, 4] | |
const add = (x) => x + 1; | |
const substract = (x) => x - 1; | |
function mapArray(values, func) { return values.map(func); } | |
mapArray([1, 2, 3], add) | |
> (3) [2, 3, 4] |
const add = (x, y) => x + y | |
add(1,3) | |
const createAdder = (a) => (b) => add(a, b) // Higher order function | |
const add2 = createAdder(3) | |
add2(1) |