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
<?xml version="1.0"?> | |
<configuration> | |
<system.web> | |
<compilation debug="true" targetFramework="4.5" /> | |
<httpRuntime targetFramework="4.5" /> | |
</system.web> | |
<system.webServer> | |
<rewrite> | |
<rules> |
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 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 | |
) |
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
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 ''; |
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
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; |
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
// This curried function return a function that allows to transform any collection of object towards another collection by using a translation schema | |
// use it like like | |
// let extractSomething = fieldMapper({ wantedProp:'TargetProperty', wantedProp1: 'target.property'}); | |
// let transformedCollection = extractSomething(dataToTransform) | |
fieldMapper(schema) { | |
let _schema = _.clone(schema); | |
return (items) => { | |
return _.chain(items) | |
.map((obj) => { | |
return _.mapValues(_schema, (path) => { |
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
import * as _ from 'lodash'; | |
// This curried function return a function that allows to transform any collection of object towards another collection by using a translation schema | |
// use it like like | |
// let extractSomething = DataMapper({ wantedProp:'TargerProperty', wantedProp1: 'target.property'}); | |
// let transformedCollection = extractSomething(dataToTransform) | |
// or | |
// let transformedData = DataMapper(schema, data); | |
// | |
export function DataMapper(schema: any, items?: any): any { | |
let _schema = _.clone(schema); |
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
<# | |
.SYNOPSIS | |
Pretty description of what the script do | |
.EXAMPLE | |
PS C:\> .\Script-Boilerplate.ps1 -Option "Value" | |
.EXAMPLE | |
$var = @{} | |
PS C:\> .\Script-Boilerplate.ps1 -Option "Value" -OtherOption $var | |
#> | |
[CmdletBinding()] |
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
var nbrReg = /(\d+(?:\.\d+)?)([a-z])?/i | |
var filtered = _.filter(document.querySelectorAll('.follow-item'),(i)=> { let followers = $(i).find('.item-info .item-info__subdetail .stat .stat__container').eq(1).find('.stat__number').text();let dataReg = nbrReg.exec(followers); return (dataReg[1] * ( dataReg[2] == 'k' ? 1000 :( dataReg[2]=='m'? 1000000 : 1) )) > 1000}) |
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 DataMapper(schema, items) { | |
let _schema = _.clone(schema); | |
let transformer = (items) => { | |
return _.chain(items) | |
.map((obj) => { | |
return _.mapValues(_schema, (transformation) => { | |
if(!_.isObject(transformation)){ | |
return _.get(obj, transformation); | |
} | |
else if(_.isFunction(transformation)){ |
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
{"lastUpload":"2019-05-10T14:55:05.821Z","extensionVersion":"v3.2.9"} |
OlderNewer