This file contains 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
namespace testSandbox | |
{ | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Management.Automation; | |
using System; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
public class LsHelper |
This file contains 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
var trackElements = document.querySelectorAll(".audio"); | |
console.log("Loaded " + trackElements.length + " track"); | |
var tracks = []; | |
for (var i = 0; i < trackElements.length; ++i) { | |
var trackElement = trackElements[i]; | |
var input = trackElement.querySelector("input"); | |
var title = trackElement.querySelector(".title_wrap"); | |
if (!input || !title) { |
This file contains 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
>> Register-PSSessionConfiguration -SessionType Workflow -Name CPUKiller -SessionTypeOption (New-PSWorkflowExecutionOption -MaxActivityProcesses 100) | |
114 [C:\windows\system32] | |
>> $s = New-PSSession -ConfigurationName CPUKiller | |
115 [C:\windows\system32] | |
>> icm $s { | |
>>> workflow Test-Myworkflow { | |
>>> param | |
>>> ( |
This file contains 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 Get-Action([int]$i) | |
{ | |
'public delegate void Action<' + [string]::Join(", ", (1..$i | %{"in T$_"})) + '>(' + [string]::Join(", ", (1..$i | %{"T$_ arg$_"})) + ');' | |
} | |
function Get-Func([int]$i) | |
{ | |
'public delegate TResult Func<' + [string]::Join(", ", (1..$i | %{"in T$_"})) + ', out TResult>(' + [string]::Join(", ", (1..$i | %{"T$_ arg$_"})) + ');' | |
} |
This file contains 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
#!/usr/bin/env ruby | |
require 'redcarpet' | |
require 'redcarpet/render_strip' | |
# require 'redcarpet/render_man.rb' | |
# Get stdin as a string | |
input = STDIN.readlines.join("\n") | |
# Initializes a Markdown parser | |
markdown = Redcarpet::Markdown.new(Redcarpet::Render::ManPage) |
This file contains 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
# This is $profile.CurrentUserAllHosts file | |
function Get-IsSessionIntaractive() { | |
$parentProcess = Get-Process -id (Get-WmiObject Win32_Process -Filter "ProcessId = '$pid'").ParentProcessId | |
$parentProcess.Name -eq "explorer" | |
} | |
# put your profile in this file and access it with $psrc instead of $profile | |
$psrc = 'C:\Users\sevoroby\Documents\WindowsPowerShell\psrc.ps1' | |
if (Get-IsSessionIntaractive) |
This file contains 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
// past this line to dev tools console | |
a = $(".closed.octicon"); for (var i = 0; i < a.length; i++) { a[i].style.color = 'green'}; a = $(".open.octicon"); for (var i = 0; i < a.length; i++) { a[i].style.color = 'red'} |
This file contains 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
<# | |
.SYNOPSIS | |
You should never use Write-Host to create any script output whatsoever. | |
.DESCRIPTION | |
It is generally accepted that you should never use Write-Host to create any script output whatsoever, unless your script (or function, or whatever) uses the Show verb (as in, Show-Performance). | |
That verb explicitly means “show on the screen, with no other possibilities.” Like Show-Command. | |
To fix a violation of this rule, please replace Write-Host with Write-Output in most scenarios. | |
.EXAMPLE | |
Test-WriteHost -CommandAst $CommandAst | |
.INPUTS |
This file contains 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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<!-- Replace this gist by your own blog gist --> | |
<script src="https://gist.github.com/vors/4bf101a457e6816f3c0f.js"></script> | |
<script type="text/javascript"> | |
$( document ).ready(function() { | |
$('.markdown-body > p > code') | |
.css("white-space","nowrap"); |
This file contains 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
# don't use it, it's a workaround | |
class ClassWithConst | |
{ | |
[ValidateSet(100)] | |
static [int] $CONST_FOO = 100 | |
} | |
[ClassWithConst]::CONST_FOO | |
[ClassWithConst]::CONST_FOO = 10 |
OlderNewer