Skip to content

Instantly share code, notes, and snippets.

@SpaceShot
SpaceShot / gist:1050287
Created June 28, 2011 01:32
Game1 class
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
gridTexture = Content.Load<Texture2D>("GridTemplate");
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ArenaGame
{
@SpaceShot
SpaceShot / gist:3152437
Created July 20, 2012 18:28
Linq query with customer order by to an anonymous type
XdsServicesDataContext xds = new XdsServicesDataContext();
var query = xds.SXAXDSCustomers.AsEnumerable().OrderBy(c => c.Oid, new OidComparer())
.Select( x =>
new {
Name = x.Name,
Oid = x.Oid,
UserId = x.UserId,
AllowAutoPatientRegistration = x.AllowAutoPatientRegistration,
MembershipUsersCollection = Membership.FindUsersByName(x.UserId)
@SpaceShot
SpaceShot / bouncing_clown_snippet1.cs
Created August 13, 2012 12:20
Calculate angle at which clown bounces back up
int angle = trampolineRectangle.Center.X - clownRectangle.Center.X + 90;
@SpaceShot
SpaceShot / bouncing_clown_snippet2.cs
Created August 13, 2012 12:22
Calculate Bounce based on where the clown hits for breakout style returns
// calculate bounce based on distance from clown center to trampoline center
int angle = trampolineRectangle.Center.X - clownRectangle.Center.X + 90;
float newY = 800 * (float)Math.Sin(MathHelper.ToRadians((float)(angle)));
float newX = 800 * (float)Math.Cos(MathHelper.ToRadians((float)(angle)));
clown.Velocity.X = newX;
clown.Velocity.Y = newY;
Turn on Xbox One
Start Forza 5
Wipe Game Save by holding shoulder buttons/bumpers, press Y and accept.
Uninstall Forza 5 Game from console.
Go to Settings > Blu Ray and clear persistent cache.
Turn off Xbox One by holding down power button until it beeps.
Unplug Xbox One for at least ten minutes (might be longer)
Plug in Xbox One and start up.
Start install of Forza 5.
Turn off console and wait for at least six hours, preferably more (through my workday)
@SpaceShot
SpaceShot / index.html
Created August 26, 2014 19:48 — forked from anonymous/index.html
Pointer Events Demonstration
<span id="support">No multi-touch support</span><br>
<canvas id="drawSurface" width="500px" height="500px" style="border:1px solid black;"></canvas>
@SpaceShot
SpaceShot / AudioLoopWithDelay.cs
Created February 13, 2015 12:11
Sample Unity Coroutine that loops a audio clip with a delay between plays
using UnityEngine;
using System.Collections;
public class AudioLoopWithDelay : MonoBehaviour {
public float Delay = 5.0f;
// Use this for initialization
void Start () {
StartCoroutine(YourFunctionName());
}
@SpaceShot
SpaceShot / GitLogLive.ps1
Created November 17, 2016 15:50
Git Live updates with PowerShell
# could make this an argument
cd C:\testing\poems
DO
{
clear
# could use where to figure out where git is instead of hardcoding
C:\Users\cgomez\AppData\Local\GitHub\PortableGit_284a859b0e6deba86edc624fef1e4db2aa8241a9\cmd\git.exe log --oneline
Start-Sleep -s 1.4
}
WHILE (1 -eq 1)
@SpaceShot
SpaceShot / Enable Windows Native OpenSSH.md
Last active February 16, 2022 17:06
Using Native OpenSSH Client in Windows 10

Using Native OpenSSH Client in Windows 10

Overview

Some time ago I needed to ssh into a Linux machine. For eons, a common way to do this way to use PuTTY. The point of this is not to discourage you from using PuTTY. PuTTY is fantastic.

So I had two motivations for checking out the native OpenSSH client in Windows 10:

  1. I heard SSH was now a native, but optional feature.
  2. Using PuTTY is very much a "Windows" thing to do. I wanted to gain a little of that "command line" speed and zen by being able to SSH in from any command prompt.

Why not Git Bash?

The vast majority of developers have Git on their machine and it probably shipped with Git Bash. Many developers erronesouly believe you can only use Git through Git Bash. This is an unnecessary practice that I think really slows you down.