Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
Looking for remote opportunities!

Rosberg Linhares rosberglinhares

🌍
Looking for remote opportunities!
  • Samsung
  • Toulouse, France
View GitHub Profile
@rosberglinhares
rosberglinhares / IncrementAssemblyVersion.ps1
Created May 13, 2016
Powershell script to increment assembly version
View IncrementAssemblyVersion.ps1
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
Powershell script to change assembly and file version
View ChangeAssemblyVersion.ps1
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 / flatten-array.js
Last active May 8, 2019
Theorem application test for Experienced Backend Engineer
View flatten-array.js
/*
* Copyright (c) 2019 <CompanyName>
* All rights reserved.
*/
'use strict';
function flattenArray(sourceArray) {
var resultArray = [];
@rosberglinhares
rosberglinhares / Enable-Privilege.ps1
Created Mar 17, 2018
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.
View Enable-Privilege.ps1
<#
.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 / GetNextAssemblyVersion.ps1
Last active Apr 10, 2018
Powershell script to increment and get the assembly version to be used with the EnvInject Jenkins plugin
View GetNextAssemblyVersion.ps1
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.