Skip to content

Instantly share code, notes, and snippets.

View rachelnicole's full-sized avatar
💭
being cool

Rachel White rachelnicole

💭
being cool
View GitHub Profile
@radiatoryang
radiatoryang / RaycastTargetTrigger.cs
Last active August 2, 2022 05:14
a script I give to my Unity VR classes to detect when the player is looking at something... put it on anything with a collider, and it'll know if it's being looked at or not
using UnityEngine;
using System.Collections;
using UnityEngine.VR; // we need this line here for InputTracking and VRSettings functions
// USAGE: put this on a thing you want the player to look at!
// this code will enable that thing to know if it is being looked at!
[RequireComponent (typeof(Collider)) ] // this thing needs a collider if we should look at it
public class RaycastTargetTrigger : MonoBehaviour {
@kevinSuttle
kevinSuttle / app.js
Created July 31, 2015 15:20
Loading multiple API credentials into a Node app
'use strict';
var express = require('express');
var app = express();
var config = require('./config');
// [...]
// [...]
var analytics = new Analytics(config.segment.writeKey, { flushAt: 1 });
@mdo
mdo / scss-tests.scss
Last active March 19, 2022 01:18
You can create the same set of components with HTML and (S)CSS in a handful of ways. Here's how the same set of buttons looks with base and modifier classes, as well as extends and placeholders. The goal is to measure the output—the total number of selectors and declarations. Personally, I consider fewest selectors to be more optimal (for you an…
// Original
//
// Markup:
//
// <button class="button">Button</button>
// <button class="button button-primary">Button</button>
// <button class="button button-danger">Button</button>
//
// Total selectors: 6
// Total declarations: 19
@dugdaniels
dugdaniels / index.html
Created January 7, 2013 00:34
An example of a browser-based input for Johnny-Five. Clicking the button in index.html turns on and off an LED installed on the Arduino board.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
$(document).ready(function() {
var socket = io.connect('http://localhost');
$('#button').click(function(e){
socket.emit('click');
e.preventDefault();
@mager
mager / spotify-apps-sandbox-current_track.js
Created February 10, 2012 18:22
Spotify Apps API - Get the currently playing track (JS)
/* Instantiate the global sp object; include models & views */
var sp = getSpotifyApi(1);
var models = sp.require("sp://import/scripts/api/models");
// Get the track that is currently playing
var currentTrack = models.player.track;
// If nothing currently playing
if (currentTrack == null) {
$('#now-playing').append('No track currently playing');