View Invoke-Parallel.ps1
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 Invoke-Parallel { | |
<# | |
.SYNOPSIS | |
Function to control parallel processing using runspaces | |
.DESCRIPTION | |
Function to control parallel processing using runspaces | |
Note that each runspace will not have access to variables and commands loaded in your session or in other runspaces by default. | |
This behaviour can be changed with parameters. |
View recentmost-example.ps1
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 InsertSorted($array, $item, $maxn, [scriptblock]$valueFunction) { | |
$a = $valueFunction.InvokeReturnAsIs($item); | |
$j = for($i = 0; $i -lt $array.Count; $i++) { | |
$b = $valueFunction.InvokeReturnAsIs($array[$i]); | |
if ($a -lt $b) { $i; break } | |
} | |
if($j -eq $null) { | |
return ($array[0..($array.Count-1)] + $item)[-$maxn..-1]; | |
} elseif($j -eq 0) { | |
if($array.Count -lt $maxn) { |
View terminal-color-check.ps1
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
$cs = @("Black","White","Gray","DarkGray","Red","DarkRed","Green","DarkGreen","Blue","DarkBlue","Cyan","DarkCyan","Magenta","DarkMagenta","Yellow","DarkYellow") | |
foreach ($tc in $cs) { | |
foreach ($bc in $cs) { | |
write-host " 123 " -foregroundcolor $tc -backgroundcolor $bc -noNewLine | |
} | |
write-host | |
} |
View graphemeCountExample.hs
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
import Data.Text.ICU | |
import qualified Data.Text as T | |
graphemeClustersCount :: LocaleName -> T.Text -> Int | |
graphemeClustersCount loc = length . breaks (breakCharacter loc) | |
testStr = "😀éé" | |
main :: IO () | |
main = print $ graphemeClustersCount Current $ T.pack $ testStr |
View unicodeNorm.hs
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
import Data.Text.Normalize | |
import qualified Data.Text as T | |
import GHC.IO.Encoding | |
import System.Win32.Console | |
procString :: (T.Text -> T.Text) -> String -> String | |
procString f = T.unpack . f . T.pack | |
testStr = "😀éé" |
View index.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Mouse scroll emulation test</title> | |
<link href="style.css" rel="stylesheet"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.16/p5.js"></script> | |
<script src="pointerlock.js"></script><!-- https://github.com/IceCreamYou/PointerLock.js --> | |
<script src="sketch.js"></script> | |
</head> |
View Next.QTTabBarCommand
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
<?xml version="1.0" encoding="utf-8"?> | |
<CommandButtonInfo> | |
<MetaData> | |
<DateCreated>2016-03-24T15:45:16.0981452+03:00</DateCreated> | |
<Author>MXI</Author> | |
<Contact>http://mxii.eu.org/</Contact> | |
<Description>Navigate to the next folder within common parent folder.</Description> | |
<Version>1.0</Version> | |
</MetaData> | |
<CommandButton Type="File" SubType="Normal" PersistentID="20753363"> |
View Next.QTTabBarCommand
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
<?xml version="1.0" encoding="utf-8"?> | |
<CommandButtonInfo> | |
<MetaData> | |
<DateCreated>2016-03-24T15:45:16.0981452+03:00</DateCreated> | |
<Author>MXI</Author> | |
<Contact>http://mxii.eu.org/</Contact> | |
<Description>Navigate to the next folder within common parent folder.</Description> | |
<Version>1.0</Version> | |
</MetaData> | |
<CommandButton Type="File" SubType="Normal" PersistentID="20753363"> |
View Next.QTTabBarCommand
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
<?xml version="1.0" encoding="utf-8"?> | |
<CommandButtonInfo> | |
<MetaData> | |
<DateCreated>2016-03-24T15:45:16.0981452+03:00</DateCreated> | |
<Author>MXI</Author> | |
<Contact>http://mxii.eu.org/</Contact> | |
<Description>Navigate to the next folder within common parent folder.</Description> | |
<Version>1.0</Version> | |
</MetaData> | |
<CommandButton Type="File" SubType="Normal" PersistentID="20753363"> |
View GeoInfoService.cs
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
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
namespace GeoInfoService | |
{ | |
public static class GeoInfoService | |
{ |
OlderNewer