Skip to content

Instantly share code, notes, and snippets.

View dellis1972's full-sized avatar

Dean Ellis dellis1972

View GitHub Profile
using System;
namespace UsingUsingBlocks
{
class SomethingThatDisposes : IDisposable
{
public SomethingThatDisposes()
{
Console.WriteLine("Creating");
}
private static void PreMultiplyImage(string infile, string outfile)
{
using (System.Drawing.Image image = System.Drawing.Image.FromFile(infile))
{
int w = image.Width;
int h = image.Height;
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(image);
for (int i = 0; i != bitmap.Width; ++i)
{
for (int j = 0; j != bitmap.Height; ++j)
public abstract class ViewModelBase : MvxViewModel
{
protected void ClearStackAndShowViewModel<TViewModel>()
where TViewModel : ViewModelBase
{
var presentationBundle = new MvxBundle(new Dictionary<string, string> { { PresentationBundleFlagKeys.ClearStack, "" } });
ShowViewModel<TViewModel>(presentationBundle: presentationBundle);
}
}
@dellis1972
dellis1972 / gist:4294aade0f4c2182bbf9
Created July 13, 2015 07:44
Sample MonGame GLSL .fx Shader
attribute vec4 vertex;
attribute vec2 texCoord;
void vs_main()
{
}
varying vec3 LightDirection;
varying vec3 LightColor;
varying vec3 AmbientColor;
@dellis1972
dellis1972 / workspace.sh
Created June 20, 2016 16:52 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
/Library/Frameworks/Mono.framework/Commands/xbuild /p:AndroidSdkDirectory="/Users/dean/android-toolchain/sdk" /p:AndroidNdkDirectory="/Users/dean/android-toolchain/ndk" /noconsolelogger /flp1:LogFile=/Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/tests/msbuild/nunit/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests/bin/Debug/temp/BuildBasicApplicationCheckPdb/build.log;Encoding=UTF-8;Verbosity=diagnostic /p:TargetFrameworkRootPathSearchPathsOSX="/Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/out/lib/xbuild-frameworks" /p:TargetFrameworkRootPath="/Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/out/lib/xbuild-frameworks" /p:FrameworkPathOverride="/Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/out/lib/xbuild-frameworks/MonoAndroid/v1.0" /p:MonoDroidInstallDirectory="/Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/out" /t:SignAndroidPackage temp/BuildBasicApplicationCheckPdb/UnnamedProject.csproj /p:UseHostCompilerIfAvailable=false /p:BuildingInsideVisualStudio=true
Loading
@dellis1972
dellis1972 / Game1.cs
Created January 4, 2018 20:43 — forked from Jjagg/Game1.cs
MonoGame backend sample for ImGui.NET (https://github.com/mellinoe/ImGui.NET)
using System;
using System.Runtime.InteropServices;
using ImGuiNET;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Vector2 = ImGuiNET.Vector2;
using Vector3 = ImGuiNET.Vector3;
using Vector4 = ImGuiNET.Vector4;
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="_Fixedup" BeforeTargets="IncrementalClean">
<CreateItem Include="$(OutDir)*.pdb;$(OutDir)*.dll">
<Output TaskParameter="Include" ItemName="_FilesNotToDelete" />
</CreateItem>
<CreateItem Include="$([System.IO.Path]::GetFullPath('%(_FilesNotToDelete.Identity)'))"
Condition="Exists('%(_FilesNotToDelete.Identity)')">
<Output TaskParameter="Include" ItemName="_CleanCurrentFileWrites" />
</CreateItem>
</Target>
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
# Jump System/Planets
--- ------ ---------------
1 20.80 Antliae Sector VZ-P b5-5
A 6 (175) TWW
2 18.71 Antliae Sector GR-W d1-90
1 (305) HMC
2 (427) ELW
3 (575) HMC
3 31.32 HIP 55469 *
A 3 (939) HMC