Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
being cool

Rachel White rachelnicole

💭
being cool
View GitHub Profile
@radiatoryang
radiatoryang / RaycastTargetTrigger.cs
Last active May 29, 2019
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
View RaycastTargetTrigger.cs
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 Jul 31, 2015
Loading multiple API credentials into a Node app
View app.js
'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 Mar 19, 2022
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…
View scss-tests.scss
// 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 Jan 7, 2013
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.
View index.html
<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 Feb 10, 2012
Spotify Apps API - Get the currently playing track (JS)
View spotify-apps-sandbox-current_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');