Skip to content

Instantly share code, notes, and snippets.

🕹
Fixin' bugs

Erik Onarheim eonarheim

🕹
Fixin' bugs
Block or report user

Report or block eonarheim

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
@eonarheim
eonarheim / screenshot.ps1
Last active Dec 6, 2018
Screen Shot with powershell
View screenshot.ps1
## Simple screen shot powershell script
[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
# Base path to save screen shots
$basePath = "$env:USERPROFILE\Desktop\ld41-screenshots\"
# Bounding rectangle of the 1st screen (can be found in the windows display properties)
# The primary screen always starts at (0, 0), then other screens have bounds relative to the primary screen
$bounds1 = [Drawing.Rectangle]::FromLTRB(0, 0, 3240, 2160)
@eonarheim
eonarheim / AdminRestApi.ps1
Last active Jan 13, 2019
PowerShell DSC Configuration for the new Microsoft IIS.Administration Rest API
View AdminRestApi.ps1
configuration AdminRestAp {
Import-DscResource -ModuleName xPSDesiredStateConfiguration
Import-DscResource -ModuleName xNetworking
Node "webserver" {
<#
Install windows features
#>
WindowsFeature InstallIIS {
@eonarheim
eonarheim / elastic-camera.ts
Last active Aug 29, 2015
Elastic camera code
View elastic-camera.ts
var cameraVel = new ex.Vector(0, 0);
engine.on('update', function(){
// Calculate the center of mass between the players on screen
// this is sort of a naive way to do co-op camera but works for now
var playerAvg = players.reduce(function(last, current, i){
return new ex.Vector(last.x + current.x, last.y + current.y);
}, ex.Vector.Zero.clone()).scale(1/players.length);
// Grab the current focus of the camper
You can’t perform that action at this time.