Skip to content

Instantly share code, notes, and snippets.

View martea's full-sized avatar
🏠
Working from home

Mårten Andersson martea

🏠
Working from home
View GitHub Profile
@martea
martea / CodeCov.bat
Created April 24, 2017 18:13
CodeCoverage
@echo off
if "%1"=="" goto missingarg
set BASEDIR=%1
if %BASEDIR:~-1%==\ set BASEDIR=%BASEDIR:~0, -1%
for %%f in (%BASEDIR%) do set BRANCHDIR=%%~nxf
echo Using branch: %BRANCHDIR%
@martea
martea / gist:1684a18f3bff4e9fd94c9f3f4a451753
Created November 7, 2017 08:44
Create font glyphs with icomoon.md
https://icomoon.io/app/#/select
1) create svg files over the icons you want to create
2) head to https://icomoon.io/app/#/select
3) import all files you want to merge together
4) select all files.
5) go to the tab for generating font
6) adjust settings to match the library your creating
7) download & imploement, font is created enjoy
@martea
martea / gist:8d16ff6a9ff80fb02b59e73e0dcb1e80
Created November 7, 2017 08:44
Create font glyphs with icomoon.md
https://icomoon.io/app/#/select
1) create svg files over the icons you want to create
2) head to https://icomoon.io/app/#/select
3) import all files you want to merge together
4) select all files.
5) go to the tab for generating font
6) adjust settings to match the library your creating
7) download & imploement, font is created enjoy
@martea
martea / stonlyTypedEnum.cs
Last active November 16, 2017 13:41
Example of stronly typed enum with class
class MyStronlyTypedEnum
{
public static readonly MyStronlyTypedEnum Good = new MyStronlyTypedEnum(1, "GUUD", "GOOD");
public static readonly MyStronlyTypedEnum Bad = new MyStronlyTypedEnum(2, "BAED", "BAD");
public static readonly MyStronlyTypedEnum Ugly = new MyStronlyTypedEnum(3, "FUGLY", "UGLY");
private MyStronlyTypedEnum(int id, string codeId, string description)
{
Id = id;
CodeId = codeId;
@martea
martea / git.config
Created November 17, 2017 13:32
git config winmerge in %userpofile%
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = <USERNAME>
email = <EMAIL>
[mergetool]
prompt = false
@martea
martea / git_fix_history_rebase.md
Created November 23, 2017 15:25
Git history fix for copy pasted solutions

How to fix git history(Copy paste repository)

Get Commit SHA from the first commit in your solution that is broken.

$baseRepo
$repo
$repo_B
$reposFirstCommitsBaseProjectCommit = [SHA]
@martea
martea / ConvertToEncoding.ps1
Last active July 12, 2018 12:50
Convert files to specific encoding with converting, solving special chars
Add-Type -typedef @"
public class EncodingHelper
{
public static System.Text.Encoding GetEncoding(string file)
{
System.Text.Encoding encoding;
using (var reader = new System.IO.StreamReader(file, System.Text.Encoding.Default, true))
{
reader.Peek(); // you need this!
encoding = reader.CurrentEncoding;
@martea
martea / Clearlogfiles.ps1
Created July 13, 2018 09:45
Clear log files recursively
Get-ChildItem -r *.log | where FullName -Match "\\(log|logs)\\" | where LastWriteTime -LT (Get-Date).AddDays(-30)
| Remove-Item -Verbose
@martea
martea / sql_search_column_script.sql
Last active August 30, 2018 11:33
SQL Search for columns ids
SELECT COLUMN_NAME AS 'ColumnName'
,TABLE_NAME AS 'TableName'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE '%EntityId%'
ORDER BY TableName
,ColumnName;
@martea
martea / website_octopack.md
Created September 20, 2018 09:25
Website Deployment with teamcity and octopus

Solution for octopacking websites.

The thing that is different from an ordinary deploy is that websites dosent have any csproj files that you can run across and run octopack against.

But when you run msbuild agains solutionfile with website projects there will be a command line runned like this.

aspnet_compiler.exe -v /Web -p Web\ -u -f -d PrecompiledWeb\Web\

within the msbuild runtime, which is basicly a publish that is executed for that project.

so what we can do with this infomration is just to add a nuget pack step.