Skip to content

Instantly share code, notes, and snippets.

View alxhub's full-sized avatar

Alex Rickabaugh alxhub

  • Google, Inc.
  • San Francisco, CA
View GitHub Profile
@alxhub
alxhub / lock2.ts
Last active June 6, 2016 16:15 — forked from anonymous/lock2.ts
const ACQUIRE_FREQ = 1000;
// Attempt to acquire the lock. Returns an Observable that emits the relative
// time of the lease if acquired, and undefined if the attempt fails.
//
// The currentLease parameter gives the current lease time (used to compare
// when re-acquiring an already held lock) or is undefined when acquiring for
// the first time.
function tryAcquire(currentLease?): Observable<number> {
// attempt to acquire the lock...
//Make sure we're using all available stuff
using System;
using UnityEngine;
namespace PraiseTheSun
{
//Inherit ModuleScienceExperiment stuff
public class SolarExperiment : ModuleScienceExperiment{
// Check if you're around the Sun, and check height from the Surface, then post the m