Skip to content

Instantly share code, notes, and snippets.

View vad710's full-sized avatar
🎯
Focusing

Vinny vad710

🎯
Focusing
View GitHub Profile
@dlidstrom
dlidstrom / run-jasmine.js
Last active January 3, 2016 07:49
Runs Jasmine tests using PhantomJS. Adapted for use within TeamCity.
var system = require('system'),
env = system.env;
/**
* Wait until the test condition is true or a timeout occurs. Useful for waiting
* on a server response or for a ui change (fadeIn, etc.) to occur.
*
* @param testFx javascript condition that evaluates to a boolean,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
* as a callback function.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class CompanionCamera : MonoBehaviour {
// Debug shortcut keys:
public KeyCode modifier;
public KeyCode toggleButton;
// If true, this will permanently disable the SteamVR companion camera.
using UnityEngine;
using System.Collections;
public class LinkedCamera : MonoBehaviour {
// What transform to chase:
public Transform target;
// Debug keyboard controls:
public KeyCode modifier;
public KeyCode incSmooth;
@AngryAnt
AngryAnt / ComponentLister.cs
Created September 29, 2012 17:52
Example code for "Where did that component go?" blog post on AngryAnt.com
using UnityEngine;
using UnityEditor;
using System.Collections;
public class ComponentLister : EditorWindow
{
private Hashtable sets = new Hashtable();
private Vector2 scrollPosition;
@ChemiKhazi
ChemiKhazi / EnumFlagAttribute.cs
Created April 29, 2014 09:59
Unity3d property drawer for automatically making enums flags into mask fields in the inspector.
using UnityEngine;
public class EnumFlagAttribute : PropertyAttribute
{
public string enumName;
public EnumFlagAttribute() {}
public EnumFlagAttribute(string name)
{
@michaelbartnett
michaelbartnett / UnityApiUx.cs
Created February 5, 2016 23:40
particle system modules are weird
ParticleSystem ps = GetComponent<ParticleSystem>();
ps.enableEmission = false;
// warning CS0618: `UnityEngine.ParticleSystem.enableEmission' is obsolete: `enableEmission property is deprecated. Use emission.enable instead.'
ps.emission.enable = false;
// error CS1061: Type `UnityEngine.ParticleSystem.EmissionModule' does not contain a definition for `enable' and no extension method `enable' of type `UnityEngine.ParticleSystem.EmissionModule' could be found (are you missing a using directive or an assembly reference?)
ps.emission.enabled = false;
// error CS1612: Cannot modify a value type return value of `UnityEngine.ParticleSystem.emission'. Consider storing the value in a temporary variable
Function WSUSUpdate {
$Criteria = "IsInstalled=0 and Type='Software'"
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
try {
$SearchResult = $Searcher.Search($Criteria).Updates
if ($SearchResult.Count -eq 0) {
Write-Output "There are no applicable updates."
exit
}
else {
@creativcoder
creativcoder / gist:5dc5c2e35cd218ce9b5d
Last active August 22, 2022 14:41
Get list of installed packages(apps) in android via adb shell
Issue this command to terminal with your device connected :
$ adb shell pm list packages
If that doesn't work, then:
$ adb shell
$ su
$ pm list packages
@cdun
cdun / HybridPlaneManager.cs
Created January 24, 2018 11:10
Combines Vuforia image tracking and ground plane. Modified from the PlaneManager class within the Vuforia ground plane samples.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;
public class HybridPlaneManager : MonoBehaviour, ITrackableEventHandler
{
private enum PlaneMode
{
@AngryAnt
AngryAnt / TerriblyHackyLog.cs
Created August 7, 2013 18:04
Abusing reflection and the internal Unity player build error function to get stacktrace-less error logs. Not recommended for anything sane.
using UnityEngine;
using System.Reflection;
public class TerriblyHackyLog : MonoBehaviour
{
void Start ()
{
Log ("Aaaaarrrrgh!");
}