Skip to content

Instantly share code, notes, and snippets.

View rosberglinhares's full-sized avatar

Rosberg Linhares rosberglinhares

  • Samsung
  • Toulouse, France
View GitHub Profile
@rosberglinhares
rosberglinhares / flatten-array.js
Last active May 8, 2019 20:39
Theorem application test for Experienced Backend Engineer
/*
* Copyright (c) 2019 <CompanyName>
* All rights reserved.
*/
'use strict';
function flattenArray(sourceArray) {
var resultArray = [];
@rosberglinhares
rosberglinhares / Enable-Privilege.ps1
Created March 17, 2018 13:23
PowerShell script to change the type of the passed services to 'Own Process'. In this way, it is possible to check how much memory is specifically allocated to each service.
<#
.SYNOPSIS
Enables privileges in the access token of the current process. This allows the process to perform system-level actions that it could not previously.
This code was adapted from the following link: https://msdn.microsoft.com/en-us/library/windows/desktop/aa446619(v=vs.85).aspx.
.PARAMETER Privilege
Specifies, as a string array, the privileges to be enabled. More information about privileges can be found at
https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx.
.NOTES
@rosberglinhares
rosberglinhares / IncrementAssemblyVersion.ps1
Created May 13, 2016 03:42
Powershell script to increment assembly version
Param (
[Parameter(Mandatory=$true)]
[string] $AssemblyInfoPath
)
$ErrorActionPreference = 'Stop' # Stops executing on error instead of silent continue.
Set-StrictMode -Version Latest # Enforces coding rules in expressions, scripts, and script blocks. Uninitialized variables are not permitted.
$fileContent = Get-Content $AssemblyInfoPath | Out-String
$assemblyVersionCapturePattern = 'AssemblyVersion\("\d+\.\d+\.\d+\.(\d+)"\)'
@rosberglinhares
rosberglinhares / ChangeAssemblyVersion.ps1
Created May 12, 2016 03:38
Powershell script to change assembly and file version
Param (
[Parameter(Mandatory=$true)]
[string[]] $AssemblyInfoFilesPath,
[Parameter(Mandatory=$true)]
[Version] $Version
)
$ErrorActionPreference = 'Stop' # Stops executing on error instead of silent continue.
Set-StrictMode -Version Latest # Enforces coding rules in expressions, scripts, and script blocks. Uninitialized variables are not permitted.
@rosberglinhares
rosberglinhares / GetNextAssemblyVersion.ps1
Last active April 10, 2018 19:36
Powershell script to increment and get the assembly version to be used with the EnvInject Jenkins plugin
Param (
[Parameter(Mandatory=$true)]
[string] $AssemblyInfoPath,
[string] $PropertiesFilePath = 'EnvInjectProperties.txt',
[string] $PropertyName = 'NEXT_VERSION'
)
$ErrorActionPreference = 'Stop' # Stops executing on error instead of silent continue.
Set-StrictMode -Version Latest # Enforces coding rules in expressions, scripts, and script blocks. Uninitialized variables are not permitted.