Skip to content

Instantly share code, notes, and snippets.

View jobou363's full-sized avatar

Jonatan Bouillon jobou363

  • Services Informatiques Epsilon inc.
  • Montréal
View GitHub Profile
@jobou363
jobou363 / encoding-helpers.ps1
Last active February 7, 2019 05:52 — forked from jpoehls/encoding-helpers.ps1
Convert-FileEncoding and Get-FileEncoding
<#
.SYNOPSIS
Converts files to the given encoding.
Matches the include pattern recursively under the given path.
.EXAMPLE
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8
#>
function List-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') {
$count = 0
@jobou363
jobou363 / git_submodules.md
Created March 11, 2018 04:38 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@jobou363
jobou363 / Convert-Encoding.ps1
Last active December 5, 2020 18:29 — forked from jamesfdickinson/Convert-Encoding.ps1
Convert all files to UTF-8 using powershell
# encrypt files to utf-8 no bom
[string[]]$Excludes = @('**Debug**', '**bin\**', '*TemporaryGeneratedFile*.cs', '*.Designer.cs')
Get-ChildItem . -recurse -Include *.aspx, *.master, *.cs -Exclude $Excludes | ForEach-Object {
$content = $_ | Get-Content
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
$_.Fullname
@jobou363
jobou363 / bitbucketClone.ps1
Last active February 17, 2023 14:20
Powershell script to git clone or fetch all team project from bitbucket
# the purpose of the script was to do a backup of all the repositories in a bitbucket team locally
# you can add this script in a scheduler daily or a teamcity build get a backup locally of all source code
# the following script connect to bitbucket.org to get all team repositories
# it does a foreach to clone new repository or fetch, pull existing one
# use auth2 to get a token
# https://developer.atlassian.com/cloud/bitbucket/oauth-2/
# adapt the following script by
# 1- connect to your bitbucket account and create an auth consumer Key:Secret, give the read access to the project
# 2- create also an app password
# encrypt files to utf-8 no bom
[string[]]$Excludes = @('**\\Debug\\**', '**\\bin\\**', '**\\obj\\**', '*TemporaryGeneratedFile*.cs', '*.Designer.cs')
$files = Get-ChildItem -Include *.aspx, *.asmx, *.cs -Exclude $Excludes -Recurse -Path . | select FullName, @{n='Encoding';e={Get-FileEncoding $_.FullName}}
$files.count
@jobou363
jobou363 / script.ps1
Created May 22, 2020 17:50
Nuget package script for updating allowedVersions to current specified range from 1 to 1000.
$versionname = "4.8.0-alpha-JIRA-1000."
$version = "$versionname.50"
$packages = "SaiAdNet", "Sai.Core", "Sai.Infra.Cqs", "SaiAdNet.Core", "SaiAdNet.Data", "SaiAdNet.DataProvider"
$file = "D:\Git\sai-sharp-feature\SaiSharp.AdNetIntegration\packages.config"
[xml]$XmlDocument = Get-Content -Path $file
@jobou363
jobou363 / UpdateNugetPackage.ps1
Created May 22, 2020 18:12
Update a list of nuget package and set allowed versions to a range
Import-Module ".\psake\psake-v4.00\psake.psm1" -verbose -force -passthru
$nugetServerUrlPrerelease = "https://nuget.prerelease"
Write-Host "Update prerelease"
Write-Host "feed alpha : $nugetServerUrlPrerelease"
$packages = "Package1", "Package2"
$versionname = "4.8.0-alpha-JIRA-1000."
@jobou363
jobou363 / Function-Get-GitCommit.ps1
Last active January 31, 2021 17:12
Get log between 2 dates for a specific author and output log to CSV file.
# git get last month commit
function Get-GitCommit {
[CmdletBinding()] #<<-- This turns a regular function into an advanced function
param (
$dateString
)
@jobou363
jobou363 / InstallChocolateyPackages.ps1
Created October 29, 2022 15:27 — forked from ddieppa/InstallChocolateyPackages.ps1
My "must" chocolatey packages
function main {
Update-Windows-Configuration
Install-Utils
Install-Browsers
Install-Fonts