Skip to content

Instantly share code, notes, and snippets.

@ArthurHub
ArthurHub / ClipboardHelper.cs
Last active June 21, 2023 07:50
Helper class for setting HTML and plain text formatting to clipboard (http://theartofdev.com/2014/06/12/setting-htmltext-to-clipboard-revisited/)
/// <summary>
/// Helper to encode and set HTML fragment to clipboard.<br/>
/// See http://theartofdev.com/2014/06/12/setting-htmltext-to-clipboard-revisited/.<br/>
/// <seealso cref="CreateDataObject"/>.
/// </summary>
/// <remarks>
/// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki.
/// </remarks>
public static class ClipboardHelper
{
@abayer
abayer / jenkins-git-backup.sh
Last active July 16, 2024 17:17
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType progress set omnifunc=syntaxcomplete#Complete
set isfname-==
" colorscheme doriath
set aw shiftwidth=4 tabstop=4 nohls expandtab
set smartcase
@1RedOne
1RedOne / DataGridsAreFun.ps1
Created September 20, 2018 03:03
WPF Example of using and populating a DataGrid with objects in PowerShell
#Sample for this question on SO https://stackoverflow.com/questions/52405852/link-wpf-xaml-to-datagrid-in-powershell?sem=2
$inputXML = @"
<Window x:Class="WpfApp2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp2"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">