This file contains 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 Program | |
{ | |
/// <summary> | |
/// Entry point. | |
/// </summary> | |
/// <param name="args">The args.</param> | |
/// <returns></returns> | |
static int Main(string[] args) | |
{ | |
var rawConnectionString = ConfigurationManager.ConnectionStrings["db"].ConnectionString; |
This file contains 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
{ | |
// Place your snippets for sql here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
This file contains 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 () { | |
var scriptName = "embed.js"; //name of this script, used to get reference to own tag | |
var jQuery; //noconflict reference to jquery | |
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
var jqueryVersion = "1.8.3"; | |
var scriptTag; //reference to the html script tag | |
/******** Get reference to self (scriptTag) *********/ | |
var allScripts = document.getElementsByTagName('script'); |
This file contains 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 void ConfigureServices(IServiceCollection services) | |
{ | |
services | |
.AddFluentEmail("defaultsender@test.test") | |
.AddRazorRenderer() | |
.AddSmtpSender("localhost", 25); | |
} |
This file contains 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 HomePageService | |
{ | |
public static string HomeModelCacheKey = "HomeModel"; | |
private static TimeSpan cacheExpiry = new TimeSpan(12, 0, 0); //12 hours | |
private readonly PositionsGroupedByTagQuery positionsGroupedByTagQuery; | |
private readonly IAppCache cache; | |
public HomePageService(PositionsGroupedByTagQuery positionsGroupedByTagQuery, IAppCache cache) | |
{ |
This file contains 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
const path = require('path') | |
const webpack = require('webpack') | |
const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
const outputDir = './wwwroot/dist' | |
const entry = './wwwroot/js/app.js' | |
const cssOutput = 'site.css' | |
module.exports = (env) => { | |
return [{ |
This file contains 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
{ | |
"name": "austechjobs", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"dev": "cross-env ASPNETCORE_ENVIRONMENT=Development NODE_ENV=development dotnet run", | |
"watch": "webpack --watch --mode=development", | |
"build": "webpack --mode=production --optimize-minimize", |
This file contains 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 StringExtensions | |
{ | |
/// Like linq take - takes the first x characters | |
public static string Take(this string theString, int count, bool ellipsis = false) | |
{ | |
int lengthToTake = Math.Min(count, theString.Length); | |
var cutDownString = theString.Substring(0, lengthToTake); | |
if (ellipsis && lengthToTake < theString.Length) | |
cutDownString += "..."; |
This file contains 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 DataMockHelpers | |
{ | |
public Mock<IQeraUnit> GetMockUnit() | |
{ | |
var unit = new Mock<IQeraUnit>(); | |
return unit; | |
} | |
public Mock<TRepo> MockRepo<TRepo, TEntity>(List<TEntity> seedData = null, bool callBase = false, MockBehavior behavior = MockBehavior.Default) | |
where TRepo : class, IRepo<TEntity> |
This file contains 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
/// <summary> | |
/// Adds template to email from embedded resource | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="path">Path the the embedded resource eg [YourAssembly].[YourResourceFolder].[YourFilename.txt]</param> | |
/// <param name="model">Model for the template</param> | |
/// <param name="isHtml">True if Body is HTML, false for plain text (Optional)</param> | |
/// <param name="assembly">The assembly your resource is in. Defaults to calling assembly.</param> | |
/// <returns></returns> |
NewerOlder