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
const std = @import("std"); | |
const zsdl = @import("libs/zig-gamedev/libs/zsdl/build.zig"); | |
const zopengl = @import("libs/zig-gamedev/libs/zopengl/build.zig"); | |
pub fn build(b: *std.Build) void { | |
const target = b.standardTargetOptions(.{}); | |
const optimize = b.standardOptimizeOption(.{}); | |
const exe = b.addExecutable(.{ | |
.name = "hellotriangle", |
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
param ([string] $Status) | |
function Invoke-SlackRequest([string]$Url, [hashtable]$data, [hashtable]$headers) { | |
Write-Host "Making a request to slack @ $Url" | |
$Body = ConvertTo-Json -InputObject $data | |
Write-Host "Sending body: $Body" | |
$headers["Content-type"] = "application/json; charset=utf-8"; | |
$result = Invoke-RestMethod -Method 'Post' -Uri $url -Body $body -Headers $headers | |
if (!$result.ok) { | |
Write-Error "Not OK!" |
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
{ | |
"foo": 3, | |
"bar": 10 | |
} |
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
PS C:\Users\swart\projects\powershell_scripts> .\name_value_store.ps1 | |
PS C:\Users\swart\projects\powershell_scripts> Add-Data -Name "Foo" -Value 2 | |
PS C:\Users\swart\projects\powershell_scripts> Add-Data -Name "Bar" -Value 8 | |
PS C:\Users\swart\projects\powershell_scripts> Read-Data | |
Name Value |
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
param ([string] $Path) | |
Get-Item -Path $Path -ErrorAction SilentlyContinue -ErrorVariable test | Out-Null | |
if ($test.Count -eq 0) { | |
Write-Host "The file at $Path exists!" | |
} | |
else { | |
Write-Host "The file at $Path was not found." | |
} |
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
param ([string] $name, [int] $value = 0) | |
$table = @{ Name = $name; Value = $value } | |
Write-Host "Your table is:" | |
Write-Output $table | |
Write-Host "`n" | |
Write-Host "It has this many items in it: " $table.Count | |
Write-Host "`n`n" |
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 Write-Text([string]$text) { | |
Write-Host -ForegroundColor Green $text | |
} | |
function Remove-Value([int]$value, [int[]]$list) { | |
[int[]] $new_list = $null | |
foreach ($v in $list) { | |
if ($v -ne $value) { | |
$new_list += $v |
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
(Just 3,[9,1]) | |
(Nothing,[]) |
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
module Main where | |
import Control.Monad.Writer | |
main :: IO () | |
main = do | |
putStrLn $ "do notation: " ++ (show $ runWriter multWithLog) | |
putStrLn $ "binding: " ++ (show $ runWriter multiWithLogBind) | |
putStrLn $ "let and bind: " ++ (show $ runWriter multiWithLogLet) |
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
{-| | |
Module: Validator | |
Description: Parses parenthesis variations for correct nesting. | |
Parses (), <>, {}, [] etc for correct nesting, open and closing. | |
Usage: | |
$ validator '[<>{()}]' | |
[<>{()}] |
NewerOlder