Skip to content

Instantly share code, notes, and snippets.

View jmbeach's full-sized avatar
🏠

Jared Beach jmbeach

🏠
View GitHub Profile
@jmbeach
jmbeach / Resharper Floating Windows Always On Top Workaround
Created September 4, 2014 19:00
SRC: http://blog.jetbrains.com/dotnet/2012/09/28/resharper-71-early-access-is-open/ - @andrii, @adam Due to a bug in Visual Studio 2012, using ReSharper in floating windows leads to unpredictable focus switches. Microsoft is aware of the problem but there’s no time estimate for a fix from them. Upon examining a set of floating window usage scena…
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/Housekeeping/SuppressOwnerlessFloatingWindows/IsDisablingIndependentFloating/@EntryValue">False</s:Boolean>
</wpf:ResourceDictionary>
using UnityEngine;
using System.Collections;
using System;
public class PathPoint : MonoBehaviour {
int radius = 10;
public Func<Collider,GameObject, int> TriggerEnterAction;
public Func<Collider, int> TriggerExitAction;
public GameObject ObjectToDetect;
void OnDrawGizmos(){
void Start()
{
// for each node
foreach (var node in Nodes)
{
// get point class and assign your custom trigger function to it
var point = node.GetComponent<PathPoint>();
point.TriggerEnterAction = OnPathPointEnter;
// let it know to only call trigger if this is the object collided
point.ObjectToDetect = gameObject;
int OnPathPointEnter(Collider other,GameObject pathPoint)
{
//_nodeLastVisited++;
_nodeLastVisited = Nodes.IndexOf(pathPoint.transform)+1;
return 0;
}
public static class MyMiniProfiler
{
public static MiniProfilerStep XStep(this MiniProfiler profiler, string operationName)
{
return new MiniProfilerStep(profiler, operationName);
}
}
TglGroup = GameObject.Find("Toggle Group Name").GetComponent<BetterToggleGroup>();
TglGroup.OnChange += TglGroup_OnChange;
//...
void TglGroup_OnChange(Toggle newActive)
{
Debug.Log(string.Format("Toggle {0} selected",newActive.name));
}
@jmbeach
jmbeach / commandline debug.txt
Created March 27, 2016 00:13
Commandline Debug
beginning parse
statementList()
statement()
variableDeclaration()
matching treat
matching id
matching eq
matching expression
expr()
matching primary
@jmbeach
jmbeach / packages.config
Last active March 30, 2016 18:31 — forked from okhiroyuki/packages.config
Packages.Config of Chocolatey
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="vim" />
<package id="atom" />
<package id="vlc" />
<package id="python2" />
<package id="google-chrome-x64" />
<package id="firefox" />
<package id="clover" />
<package id="adobereader" />
@jmbeach
jmbeach / capslock-up-down.ahk
Created March 31, 2016 12:50
Caps-lock up down
CapsLock::
{
if state = D
{
}
else
{
Send, {Down down}
Send, {Down up}
}
@jmbeach
jmbeach / scraper.js
Created April 4, 2016 05:55
beastie scraper
// each h2 is a section
var $h2s = $("h2");
console.log($h2s.length)
var alphabet = ['A','B','C','D','E','F','G','H','I','J','K'];
function Quiz() {
var self = this;
self.concepts = [];
self.print = function() {
var txtPrint = "";
// for each concept