Skip to content

Instantly share code, notes, and snippets.

View emyann's full-sized avatar
🏠
Working from home

Yann RENAUDIN emyann

🏠
Working from home
View GitHub Profile
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.OAuth;
using Pollen.Radar.Model;
using Pollen.Radar.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
@emyann
emyann / AngularTruncateText.js
Created June 16, 2016 20:32
AngularJs filter to truncate text
angular
.module('ng')
.filter('truncate', function () {
/**
* @param {boolean} wordwise - if true, cut only by words bounds
* @param {string} max - max length of the text, cut to this number of chars
* @param {string} tail - add this string to the input string if the string was cut
*/
return function (value, wordwise, max, tail) {
if (!value) return '';
@emyann
emyann / RandomDateTimeGenerator.ps1
Created June 15, 2016 04:27
A Powershell random generator for dates and times
function Get-RandomDateBetween{
<#
.EXAMPLE
Get-RandomDateBetween -StartDate (Get-Date) -EndDate (Get-Date).AddDays(15)
#>
[Cmdletbinding()]
param(
[parameter(Mandatory=$True)][DateTime]$StartDate,
[parameter(Mandatory=$True)][DateTime]$EndDate
)
@emyann
emyann / web.config
Last active August 21, 2017 17:21
ASP.NET web.config configuration for Single Page Application (AngularJS) running on IIS with OwinHttpHandler
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<rewrite>
<rules>