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
# Generate a random Alphanumeric string | |
Function Get-RandomAlphanumericString { | |
[CmdletBinding()] | |
Param ( | |
[int] $length = 8 | |
) | |
Begin{ |
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 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.0"> | |
<title>Gist List</title> | |
<script> | |
function addElement(str, link) { |
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
docker run \ | |
--name {{printf "%q" .Name}} \ | |
{{- with .HostConfig}} | |
{{- if .Privileged}} | |
--privileged \ | |
{{- end}} | |
{{- if .AutoRemove}} | |
--rm \ | |
{{- end}} | |
{{- if .Runtime}} |
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
# Compress and decompress byte array | |
function Get-CompressedByteArray { | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)] | |
[byte[]] $byteArray = $(Throw("-byteArray is required")) | |
) | |
Process { |
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
let numbers = Application('Numbers') | |
numbers.includeStandardAdditions = true | |
numbers.activate() | |
delay(1) | |
SystemEvents = Application('System Events') | |
Notes = SystemEvents.processes['Numbers'] | |
let jsonStr = "[{\"datum\":\"26 januari 2018 16:28\",\"biljett\":\"Enkelbiljett\",\"pris\":\"39,00\",\"moms\":\"2,21\",\"total\":\"39,00\"},{\"datum\":\"24 januari 2018 17:09\",\"biljett\":\"Enkelbiljett\",\"pris\":\"39,00\",\"moms\":\"2,21\",\"total\":\"39,00\"},{\"datum\":\"20 januari 2018 16:14\",\"biljett\":\"Enkelbiljett\",\"pris\":\"47,00\",\"moms\":\"2,66\",\"total\":\"47,00\"},{\"datum\":\"14 januari 2018 02:17\",\"biljett\":\"Enkelbiljett\",\"pris\":\"27,00\",\"moms\":\"1,53\",\"total\":\"27,00\"},{\"datum\":\"13 januari 2018 18:06\",\"biljett\":\"Enkelbiljett\",\"pris\":\"27,00\",\"moms\":\"1,53\",\"total\":\"27,00\"},{\"datum\":\"22 december 2017 14:22\",\"biljett\":\"Enkelbiljett\",\"pris\":\"46,00\",\"moms\":\"2,60\",\"total\":\"46,00\"},{\"datum\":\"21 december 2017 17:20\",\"biljett\":\"Enkelbiljett\",\"pr |
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 groovy | |
import javax.crypto.SecretKeyFactory | |
import javax.crypto.SecretKey | |
import javax.crypto.Cipher | |
import javax.crypto.spec.PBEParameterSpec | |
import javax.crypto.spec.PBEKeySpec | |
import java.util.Base64 | |
import java.util.Base64.Decoder | |
import static java.nio.charset.StandardCharsets.UTF_8 |
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 java.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.TimeUnit; |
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" standalone='no'?> | |
<!DOCTYPE service-group SYSTEM "avahi-service.dtd"> | |
<service-group> | |
<name replace-wildcards="yes">%h</name> | |
<service> | |
<type>_adisk._tcp</type> | |
<txt-record>sys=waMa=0,adVF=0x100</txt-record> | |
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record> | |
</service> | |
<service> |
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 groovy | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.nio.charset.StandardCharsets; | |
import java.lang.StringBuilder; | |
import java.util.concurrent.TimeUnit; |
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
[string] $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition | |
[string] $fileName = $($MyInvocation.MyCommand).ToString().Replace(".ps1", ".dll") | |
[string] $dllPath = Join-Path $scriptPath $fileName | |
Write-Host "Dll fileName: $($fileName)" | |
Write-Host "Dll scriptPath: $($scriptPath)" | |
Write-Host "Dll Path: $($dllPath)" | |
NewerOlder