Skip to content

Instantly share code, notes, and snippets.

View jbubriski's full-sized avatar

John Bubriski jbubriski

View GitHub Profile
@codeimpossible
codeimpossible / JamesBond.cs
Created October 28, 2014 02:52
JamesBond - a quick and dirty lesson in reflection, invocation and generally mucking about with an objects private vars
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;
using System.Reflection;
using System.Linq.Expressions;
namespace MISix {
public class ReflectedResult<T> {
anonymous
anonymous / About.cshtml
Created November 10, 2011 14:27
Example of a base view for razor with RouteInfo property
@{
ViewBag.Title = "About Us";
}
<h2>About</h2>
<p>
Hi @RouteInfo.name(), welcome to the @RouteInfo.action() action, which is located in the @RouteInfo.controller() controller
</p>
@motowilliams
motowilliams / gist:3784042
Created September 25, 2012 19:51
motowilliams opml for Google Listen
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>"Listen Subscriptions" subscriptions via MotoWilliams in Google Reader</title>
</head>
<body>
<outline title="Listen Subscriptions" text="Listen Subscriptions">
<outline text="(406)Sta-rtup" title="(406)Sta-rtup"
type="rss" xmlUrl="http://406startup.com/feed/" htmlUrl="http://406startup.com"/>
anonymous
anonymous / gist:5556157
Created May 10, 2013 17:56
var setCookieHeader = response.Headers["SET-COOKIE"];
var sltCookie = setCookieHeader.Substring(0, setCookieHeader.IndexOf(';'));
if (sltCookie.StartsWith("slt"))
{
Cookies.Add(new Cookie("slt", sltCookie.Substring(4), "/", "www.litefighter.com"));
}
@developerdizzle
developerdizzle / ajax-loading.js
Last active December 18, 2015 10:19
jQuery/UpdatePanel busy/loading cursor
// html.ajax-loading { cursor: wait; }
define(['jquery'], function ($) {
$(function () {
var $html = $('html');
var $document = $(document);
var cssClass = 'ajax-loading';
var requests = 0;
function setBusy() {
@phoboslab
phoboslab / menus.js
Created November 11, 2012 22:13
Z-Type Menu
ig.module(
'game.menus'
)
.requires(
'impact.font'
)
.defines(function(){
MenuItem = ig.Class.extend({
getText: function(){ return 'none' },
@topas
topas / gist:1919858
Created February 26, 2012 23:48
ASP.NET MVC Html.LabelFor helper with html attributes
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Routing;
public static class LabelExtensions
{
public static MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, object htmlAttributes)
{
@codeimpossible
codeimpossible / GameManager.cs
Created November 22, 2017 20:42
Cross Platform GamePad Input for Unity
using System;
using UnityEngine;
public class GameManager : MonoBehaviour {
public IInputSystem Input;
public static GameManager Instance;
void Awake() {
@zachstronaut
zachstronaut / example.js
Last active November 27, 2017 14:55
Support for 1 - 4 Gamepad Controllers in Impact.js for Local Multiplayer Games
// bind keyboard and gamepad buttons
ig.input.bind( ig.KEY.X, 'shoot1');
ig.input.bind( ig.GAMEPAD1.FACE_1, 'shoot1');
ig.input.bind( ig.GAMEPAD2.FACE_1, 'shoot2');
ig.input.bind( ig.GAMEPAD3.FACE_1, 'shoot3');
ig.input.bind( ig.GAMEPAD4.FACE_1, 'shoot4');
@mrcarriere
mrcarriere / StopPlayingOnRecompile.cs
Last active October 11, 2018 16:42
Force Unity to stop playing if you have edited a source file. Helps avoid some editor crashes and false positives / error spam. To use, drop this script in an "Editor" folder in your project.
using UnityEditor;
[InitializeOnLoad]
public class StopPlayingOnRecompile
{
static StopPlayingOnRecompile()
{
AssemblyReloadEvents.beforeAssemblyReload += () =>
{
if (EditorApplication.isPlaying)