Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
echo $1 $2
while read local_ref local_sha remote_ref remote_sha
do
echo $local_ref $local_sha $remote_ref $remote_sha
invalid_message=$(git log --pretty=%s $remote_sha..$local_sha | grep 'fixup\|WIP')
if [ -n "$invalid_message" ]; then
echo "error: A commit szövege invalid kifejezést tartalmaz:"
@ADIX7
ADIX7 / SyncedWorkspaces.md
Created July 29, 2019 17:07
Synced Git workspaces config

Participants:

  • origin: Main repository. This is a remote repository.
  • work1: Main working repository.
  • mirror: The 'sync' repository between work1 and work2. This is a bare repository with no remotes. It is accessible from work1 and work2
  • work2: The secondary working repository.
$localBranches = git branch --no-color --format="%(refname:short)" -l
$remoteBranches = git branch --no-color --format="%(refname:short)" -r
$branchSummary = ($localBranches | Where-Object { $remoteBranches -contains ("origin/" + $_)} | ForEach-Object {
$name = $_
[pscustomobject]@{name = "$name"; diff = git rev-list "$name...origin/$name" --oneline --left-right}
} | Where-Object {$_.diff.Length -gt 0} | ForEach-Object {
$name = $_.name
$incoming = ($_.diff | Where-Object { $_.StartsWith(">")}).Length
$outgoing = ($_.diff | Where-Object { $_.StartsWith("<")}).Length
@ADIX7
ADIX7 / Description.md
Created July 18, 2019 13:12
DuckDuckGo GreaseMonkey scripts

InstantBang.js

ReSearch.js

SearchOnNewTab.js

@ADIX7
ADIX7 / Main.ruleset
Last active July 14, 2019 07:13
Main Analyzer ruleset
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="16.0">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="MinimumRecommendedRules_Name" />
<Description Resource="MinimumRecommendedRules_Description" />
</Localization>
<Include Path=".sonarlint\bimvisualizercsharp.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
@ADIX7
ADIX7 / ifExtension.cs
Created July 3, 2019 13:43
Extension method for bool to use if block as expression body
public static class IfExtensions
{
public static void IfTrue(this bool condition, Action action)
{
if(condition) action();
}
public static bool IfTrue(this bool condition, Func<bool> func)
{
if(condition) return func();
@ADIX7
ADIX7 / .gitattributes
Last active July 1, 2019 05:48
Unity git settings
# Unity files
*.unity -text merge=unityyamlmerge diff