Skip to content

Instantly share code, notes, and snippets.

View leandroribeiro's full-sized avatar
🎯
Focusing

Leandro Ribeiro leandroribeiro

🎯
Focusing
View GitHub Profile
@EdCharbeneau
EdCharbeneau / Enable-Transformations.md
Last active May 6, 2024 11:44
How to enable transformations on build with Visual Studio

#Transform web.config on build

  1. Unload the project
  2. Edit .csproj
  3. Append figure 1 to the end of the file just before </Project>; v12.0 my change depending on your version of Visual Studio
  4. Save .csproj and reload
  5. Open configuration manager
  6. Add a new Configuration Name: Base. Copy settings from: Release
  7. Copy the contents of your web.config
  8. Right click Web.Config > Add Config Transformation
@mwhite
mwhite / git-aliases.md
Last active May 10, 2025 04:07
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active May 14, 2024 15:14
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@rfolkes
rfolkes / PublishDemoClient.xml
Last active February 24, 2021 02:49
MSBuild script to build & publish a ClickOnce application with TeamCity without any other dependencies than installing certificates on the build agents.
<Project DefaultTargets="DoPublish" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(teamcity_build_workingDir)\Trunk\BuildScripts\DemoClient\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<VersionFile>$(teamcity_build_workingDir)\Trunk\DemoClient\Properties\SharedAssemblyInfo.cs</VersionFile>
<ClickOnceBuildDirectory>$(teamcity_build_workingDir)\Trunk\DemoClient\bin\$(Configuration)\app.publish</ClickOnceBuildDirectory>
<ClickOnceInstallDirectory>$(teamcity_build_workingDir)\Publish\DemoClient</ClickOnceInstallDirectory>
<ClickOnceHtmFileLocation>$(teamcity_build_workingDir)\Trunk\BuildScripts\DemoClient\publish.htm</ClickOnceHtmFileLocation>
<ClickOnceBuildEngineSourceDirectory>$(teamcity_build_workingDir)\Trunk\BuildScripts\DemoClient\Engine</ClickOnceBuildEngineSourceDirectory>
@elizabeth-young
elizabeth-young / PasswordHash.cs
Last active July 12, 2019 21:18
Password methods to hash and validate a password
public class PasswordHash
{
private const int SALT_BYTES = 24;
private const int HASH_BYTES = 24;
private const int PBKDF2_ITERATIONS = 1000;
private const int ITERATION_INDEX = 0;
private const int SALT_INDEX = 1;
private const int PBKDF2_INDEX = 2;
@mrchief
mrchief / Deploy-Windows-Service-Via-MSBuild.proj.xml
Last active June 26, 2024 09:37
MSBuild Script to deploy Windows Service to remote or local machine
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
@jpoehls
jpoehls / mklink.psm1
Created June 7, 2012 19:40
Native PowerShell wrapper for MKLINK.
@diegocaxito
diegocaxito / CadastrarDinnerTeste.cs
Created February 11, 2012 23:26
Criando Testes de Interface em .Net com Selenium WebDriver para a aplicação NerdDinner
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.IE;