Skip to content

Instantly share code, notes, and snippets.

View RichLogan's full-sized avatar

Rich Logan RichLogan

View GitHub Profile
import json
from opensky_api import OpenSkyApi
api = OpenSkyApi()
states = api.get_states()
results = {}
results["states"] = []
for state in states.states:
@RichLogan
RichLogan / SparkSpeech.cs
Created August 30, 2016 09:42
HoloLens Spark -> Speech
#if UNITY_WSA
using Cisco.Spark;
using HoloToolkit.Unity;
using System.Collections;
using System.Text;
using UnityEngine;
using UnityEngine.Windows.Speech;
public class SparkSpeechRecognition : MonoBehaviour
{

Phil

  • 1x Hololens
  • 1x 1080p Camera
  • Rollup Banner
  • 1x Magwell
  • AP + Cables

Rich

  • 1x Hololens
  • 1x Magwell

Keybase proof

I hereby claim:

  • I am RichLogan on github.
  • I am richlogan (https://keybase.io/richlogan) on keybase.
  • I have a public key whose fingerprint is 44A7 8E62 FE02 B93A 15FF 944B 781C B0D3 6616 6779

To claim this, I am signing this object:

@RichLogan
RichLogan / DoubleSidedShader.shader
Created August 8, 2016 15:29
Unity DoubleSidedShader for Quads
Shader "Custom/DoubleSided" {
Properties{
_Color("Color", Color) = (1,1,1,1)
[NoScaleOffset] _MainTex("Albedo (RGB)", 2D) = "white" {}
[Toggle] _UseMetallicMap("Use Metallic Map", Float) = 0.0
[NoScaleOffset] _MetallicGlossMap("Metallic", 2D) = "black" {}
[Gamma] _Metallic("Metallic", Range(0,1)) = 0.0
_Glossiness("Smoothness", Range(0,1)) = 0.5
_BumpScale("Scale", Float) = 1.0
[NoScaleOffset] _BumpMap("Normal Map", 2D) = "bump" {}

Screeps

  • Why are some units getting their role unset?
  • Need to place and retrieve energy from ALL available energy sources
  • Need to distribute body parts according to template + available energy
  • Need walls and repairers
  • Test a scout?
  • Whitelist enrique
@RichLogan
RichLogan / mesh.cs
Last active June 7, 2016 14:27
Dynamic Meshes
_mesh = new Mesh();
_mesh.name = "Line Mesh";
_mesh.MarkDynamic();
// Some mesh manipulation occurs here
_mesh.Optimize();
_mesh.UploadMeshData(true);
Debug.Log(_mesh.isReadable); // showing false
byte[] serialised_mesh = MeshSerializer.WriteMesh(_mesh, false);
// Mesh Serializer basically reads mesh.vertices, mesh.normals etc etc.
Debug.Log(serialised_mesh.Length);

Hi all,

I'm having trouble spawning dynamically created objects onto the server/client. I know that my issue is related to the registration of the "prefab" (ClientScene.RegisterPrefab) but I can't figure out how to solve it. I've seen a couple of questions and answers on this topic, but they don't seem to help.

At the moment I've got this:

 [Command]
     void Cmd_SpawnAnObject()
     {
 GameObject spawned_object = GameObject.CreatePrimitive(PrimitiveType.Cube);
@RichLogan
RichLogan / no_dupes.py
Last active March 30, 2016 10:41
Remove duplicate rows per column
import csv
import sys
column = input("Which column do you want to test on? (Starting from 0): ")
delimiter = raw_input("How if your file deliminated? ")
duplicate_count = 0
with open(sys.argv[1], 'r') as input_file, open(sys.argv[1].split('.')[0] + "_fixed.csv", 'w') as output_file:
seen = set()
for line in input_file.readlines():
@RichLogan
RichLogan / .zshrc
Created February 1, 2016 15:28
ZSH Profile
DEFAULT_USER=rilogan
# Path to your oh-my-zsh installation.
export ZSH=/home/rilogan/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"