This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build -f ./cron.docker --tag cronsample:local . | |
docker run -d cronsample:local --name cronsample_rhysc | |
# Wait a bit, a minute in fact | |
docker container cp cronsample_rhysc:/var/log/cron.log ./cron.log | |
cat ./cron.log | |
# Should see "Hello world" printed on a new line for every minute the container has been running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 'SELECT ' || string_agg(column_name, ', ') || ' FROM ' || table_name | |
FROM information_schema.columns | |
WHERE table_schema='my_schema' | |
GROUP BY table_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# opens a GUI to manage users under the given account - fine for adding/upodate one or two accounts | |
runas /user:myDomain\myusername "C:\Windows\System32\rundll32.exe dsquery, OpenQueryWindow" | |
##POWERSHELL – to load the users, done from a server so it has the AD PS modules | |
import-module activedirectory | |
# basic search using ps filters | |
Get-ADUser -filter {GivenName -like "rickie"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Calendar Demo</title> | |
<!-- BEGIN CALENDAR CSS - ideally these would be in a separate file - eg /calendar-template.css --> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- pervious msbuild project cruft clipped this is just a .csproj--> | |
<ItemGroup> | |
<Content Include="..\OtherProject\libs\**\*.dll"> | |
<Link>libs\%(RecursiveDir)%(Filename)%(Extension)</Link> | |
<!-- copy after the build so i can have the dlls in a linked lib folder in the project bt in the root in bin --> | |
<CopyToOutputDirectory>Never</CopyToOutputDirectory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//using System; | |
//using Xunit; | |
public class IgnoreUntilFactAttribute : FactAttribute | |
{ | |
public int Year { get; set; } | |
public int Month { get; set; } | |
public int Day { get; set; } | |
public override string Skip | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
new MyObject().Dispatch(new Bar()); | |
/* OUTPUT: | |
Easy more specific target | |
Hitting the Bar | |
Fooing it up | |
Easy target | |
*/ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ErrorActionPreference = "Stop" | |
function cleanBin { | |
param ([string]$path) | |
write-host "Cleaning bin from: $path" | |
get-childitem $path -include bin -recurse | remove-item -force -confirm:$false -recurse | |
write-host "Cleaning obj from: $path" | |
get-childitem $path -include obj -recurse | remove-item -force -confirm:$false -recurse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Guard | |
{ | |
public static void NotNull<T>(Expression<Func<T>> notNullableExpression) where T : class | |
{ | |
var compliedExpression = notNullableExpression.Compile(); | |
if (compliedExpression() == null) | |
{ | |
var paramName = notNullableExpression.GetObjectNameGraph(); | |
throw new ArgumentNullException(paramName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search-files { | |
param ( [string]$fileFilter, | |
[string]$text) | |
$PathArray = @() | |
Get-ChildItem -Filter $fileFilter -Recurse | | |
Where-Object { $_.Attributes -ne "Directory"} | | |
ForEach-Object { | |
If (Get-Content $_.FullName | Select-String -Pattern $text) { | |
$PathArray += $_.FullName |
NewerOlder