Skip to content

Instantly share code, notes, and snippets.

View cbilson's full-sized avatar

Chris Bilson cbilson

View GitHub Profile
import java.awt.Color;
import ihs.apcs.spacebattle.BasicEnvironment;
import ihs.apcs.spacebattle.BasicSpaceship;
import ihs.apcs.spacebattle.Point;
import ihs.apcs.spacebattle.RadarResults;
import ihs.apcs.spacebattle.RegistrationData;
import ihs.apcs.spacebattle.commands.IdleCommand;
import ihs.apcs.spacebattle.commands.RadarCommand;
import ihs.apcs.spacebattle.commands.RotateCommand;
import java.awt.Color;
import ihs.apcs.spacebattle.BasicEnvironment;
import ihs.apcs.spacebattle.BasicSpaceship;
import ihs.apcs.spacebattle.ObjectStatus;
import ihs.apcs.spacebattle.Point;
import ihs.apcs.spacebattle.RadarResults;
import ihs.apcs.spacebattle.RegistrationData;
import ihs.apcs.spacebattle.commands.BrakeCommand;
import ihs.apcs.spacebattle.commands.IdleCommand;
#include <PCM.h>
const unsigned char DogBark[] PROGMEM = {
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 12
import java.util.Scanner;
public class BoardMatrix {
static char[][] matrix = new char[3][3];
public static void main(String[] args) {
BoardMatrix.assignMatrix();
boolean gameOver = false;
import java.io.File;
import java.io.FileNotFoundException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Scanner;
public class DroidExpenses {
public static void main(String[] args) throws FileNotFoundException {
//Scanner scanner = new Scanner(System.in);
Scanner scanner = new Scanner(new File("C:\\Users\\cbilson\\DroidExpenses.txt"));
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Absolutely {
public static void main(String[] args) throws FileNotFoundException {
//Scanner scanner = new Scanner(System.in);
Scanner scanner = new Scanner(new File("C:\\Users\\cbilson\\Absolutely.txt"));
int problems = scanner.nextInt();
function Sleep-Computer {
[CmdletBinding(SupportsShouldProcess=$True,ConfirmImpact="Low")]
param([switch]$Force)
if ($pscmdlet.ShouldProcess($env:COMPUTERNAME)) {
if ($Force.IsPresent) {
if ($pscmdlet.ShouldProcess("Turning off hibernation")) {
& powercfg -hibernate off
}
}
function Set-WindowsTheme {
param([ValidateSet('Light', 'Dark')] $Value)
foreach ($path in 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize')
{
$personalize = if (Test-Path $path) {
Get-Item $path
} else {
New-Item $path
@cbilson
cbilson / Prompt.ps1
Created July 8, 2015 16:15
Powershell+Posh-Git prompt function that does not hang ConEmu
function Test-IsAdmin {
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = new-object Security.Principal.WindowsPrincipal($currentUser)
$principal.IsInRole("Administrators")
}
$global:IsCurrentUserAdministrator = Test-IsAdmin
function global:prompt {
$realLastExitCode = $LastExitCode
@cbilson
cbilson / Program.cs
Created April 22, 2015 15:23
Migrating C# OWIN app to ClojureCLR
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using clojure.clr.api;
using clojure.lang;
using Microsoft.Ajax.Utilities;
using Microsoft.Owin.Hosting;
using Owin;