Skip to content

Instantly share code, notes, and snippets.

🦀
Programming something in Rust, probably

Matthew J. Berger matthewjberger

🦀
Programming something in Rust, probably
Block or report user

Report or block matthewjberger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthewjberger
matthewjberger / christmas.ps1
Last active Dec 7, 2019
Generating christmas gift pairings with Powershell!
View christmas.ps1
$people = @("Matthew", "Nikky", "Lana", "Chris", "Tawny", "Briana")
$picked = [System.Collections.ArrayList]@()
$people | %{
$person = $_
$choices = $people | ?{ !$picked.Contains($_) -and $_ -ne $person}
$partner = Get-Random -InputObject $choices
$picked.Add($partner) | Out-Null
Write-Host "$person -> $partner"
}
@matthewjberger
matthewjberger / profile.ps1
Last active Nov 22, 2019
a function for your powershell profile to interactively select one of your git repos with fzf
View profile.ps1
# Find repo
function fr() {
$repos_dir_name = "code"
$dir = Resolve-Path $(Join-Path $env:HOME $repos_dir_name)
$codedirs = Get-ChildItem $dir | Where-Object { $_.PSIsContainer }
$selection = $codedirs | Select-Object -ExpandProperty Name | fzf
if (-not ($selection)) {
Write-Host -ForegroundColor Red "No repo selected"
return
}
@matthewjberger
matthewjberger / profile.ps1
Created Nov 22, 2019
a simple function for your powershell profile to interactively select one of your git repos with fzf
View profile.ps1
# Find repo
function fr() {
$repos_dir_name = "code"
$dir = Resolve-Path $(Join-Path $env:HOME $repos_dir_name)
$codedirs = Get-ChildItem $dir | Where-Object { $_.PSIsContainer }
$selection = $codedirs | Select-Object -ExpandProperty Name | fzf
if (-not ($selection)) {
Write-Host -ForegroundColor Red "No repo selected"
return
}
View defines.md

If any of these symbols are prepended to the source for the pbr shaders before shader compilation, they affect the shader's operation. This allows various models to be rendered with different combinations of settings, using the same shader.

The official viewer keeps track of a shader identifier and the defines permutation (excluding the prefix HAS_, to know if a shader for that exact permutation has been compiled and can be loaded from the shader cache.

// example args: "pbr.vert", ["NORMALS", "TANGENTS"]

Scraped using powershell in the src/shaders folder of the KhronosGroup/glTF-Sampler-Viewer repo:

@matthewjberger
matthewjberger / Cargo.toml
Last active Oct 29, 2019
Using petgraph to create a scene graph and traverse it non-recursively with DFS, keeping track of transformations via indices
View Cargo.toml
[package]
name = "dfs"
version = "0.1.0"
authors = ["Matthew J. Berger <matthewberger@nevada.unr.edu>"]
edition = "2018"
[dependencies]
petgraph = "0.4.13"
@matthewjberger
matthewjberger / arch.txt
Created Sep 27, 2019
arch linux wsl notes
View arch.txt
# scoop install vcxsrv
# https://github.com/yuk7/ArchWSL
# launch xlauncher
# choose 0 for display number
# Uncheck 'use native gl'
in arch:
pacman-key --populate archlinux
pacman -Syyu
@matthewjberger
matthewjberger / Cargo.toml
Last active Sep 24, 2019
Single file Glutin window example updated for 2019
View Cargo.toml
[package]
name = "glutin-test"
version = "0.1.0"
authors = ["Matthew J. Berger <matthewberger@nevada.unr.edu>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
glutin = "0.22.0-alpha2"
View witchy-wares.md

Witchy Wares

Dimensions:

Width 128

Height 128

Rows

View keybase.md

Keybase proof

I hereby claim:

  • I am matthewjberger on github.
  • I am matthewjberger (https://keybase.io/matthewjberger) on keybase.
  • I have a public key ASDpfMsODQxf17iUu_gkNo8WyFuub-vvMoeleAdPfSLfCAo

To claim this, I am signing this object:

View statemachine.rs
#[derive(Debug, PartialEq)]
pub enum State {
Intro,
StartScreen,
PlayGame,
Paused,
Faulted,
}
#[derive(Debug, Clone, Copy)]
You can’t perform that action at this time.