Skip to content

Instantly share code, notes, and snippets.

@alan-null
alan-null / git checkout master
Created July 14, 2015 15:36
A clink script for supporting tab-completion of git branches when using "git checkout"
function git_checkout_match_generator(text, first, last)
found_matches = false;
if rl_state.line_buffer:find("^git checkout ") then
has_start_branch = not rl_state.line_buffer:find("^git checkout[ ]*$")
for line in io.popen("git branch 2>nul"):lines() do
local m = line:match("[%* ] (.+)$")
if m then
if not has_start_branch then
clink.add_match(m)
@alan-null
alan-null / notepad regex
Created July 14, 2015 15:37
Collection of regex used in notepad to improve productivity
# Cach style tag insige HTML elements.
style="(.)+?"
@alan-null
alan-null / context.getCommands.js
Created May 13, 2016 23:09
Display all available commands for current context
[].forEach.call(scExtManager.getModule(SitecoreExtensions.Modules.Launcher.LauncherModule).commands.filter(function (c, i, a) {
return c.canExecute();
}), function(c) {
console.log(c.name + " | " + c.description)
})
LWin & WheelUp::
; Previous Desktop
Send {LWin down}{Ctrl down}{Left down}{LWin up}{Ctrl up}{Left up}
return
LWin & WheelDown::
; Next Desktop
Send {LWin down}{Ctrl down}{Right down}{LWin up}{Ctrl up}{Right up}
return
function copyToClipboard( text ){
var copyDiv = document.createElement('div');
copyDiv.contentEditable = true;
document.body.appendChild(copyDiv);
copyDiv.innerHTML = text;
copyDiv.unselectable = "off";
copyDiv.focus();
document.execCommand('SelectAll');
document.execCommand("Copy", false, null);
document.body.removeChild(copyDiv);
@alan-null
alan-null / Merge-Layout.ps1
Last active January 20, 2018 11:46
Merging Final Renderings back down into Shared Renderings
function Merge-Layout {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true)]
[item]$Item
)
process {
$layoutField = New-Object "Sitecore.Data.Fields.LayoutField" -ArgumentList ($Item.Fields[[Sitecore.FieldIDs]::LayoutField]);
$finalLayoutField = New-Object -TypeName "Sitecore.Data.Fields.LayoutField" -ArgumentList $Item.Fields[[Sitecore.FieldIDs]::FinalLayoutField]
@alan-null
alan-null / ToastNotification_Windows10.ps1
Created October 13, 2016 10:50 — forked from altrive/ToastNotification_Windows10.ps1
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
function Get-KeyPropertyValue($key, $property)
{
if($key.Property -contains $property)
{
Get-ItemProperty $key.PSPath -name $property | select -expand $property
}
}
function Get-VersionName($key)
{

Feedly - mark as read

This script allows you to mark as read and hide articles that might not be interesting.

Decision is made based on the engagement value of each entry.

How it works

Once you run the script you wil be asked to provide two values:

  • minimum engagement - value of the engagement that allows to make a decision whether article should be dismissed or not.
@alan-null
alan-null / README.md
Created January 8, 2017 10:29
AutoHotkey scripts

What is AutoHotkey?

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language