Skip to content

Instantly share code, notes, and snippets.

View bretdavidson's full-sized avatar

Bret Davidson bretdavidson

  • North Carolina State University Libraries
View GitHub Profile
@bretdavidson
bretdavidson / error.txt
Created March 11, 2017 18:15
conda build r-plotly error
conda build r-plotly/
BUILD START: r-plotly-4.5.6-r3.3.2_0
(actual version deferred until further download or env creation)
updating index in: /usr/local/Anaconda3-4.3.0-Linux-x86_64/conda-bld/linux-64
updating index in: /usr/local/Anaconda3-4.3.0-Linux-x86_64/conda-bld/noarch
The following NEW packages will be INSTALLED:
bzip2: 1.0.6-3
cairo: 1.14.8-0
var ann,
bar,
chart,
g,
gBar,
gEnter,
gRule,
line,
rects,
rule,
def update
@computer = Computer.find_by mac_address: params[:id]
if @computer
if @computer.update_attributes(:status => params[:status])
render json: {:message => 'Computer Updated'}, status: 200
else
render json: {:errors => @computer.errors.full_messages}, status: 422
end
else
render json: {:message => 'Computer Not Found'}, status: 404
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="u.nest.js"></script>
<style>
.node circle {
fill: #fff;
stroke: steelblue;
@bretdavidson
bretdavidson / gist:1a769920d3a90fac4c5d
Created April 3, 2015 19:22
Vagrant config stuff
# Before Vagrant.configure()
required_plugins = %w(vagrant-timezone)
required_plugins.each do |plugin|
need_restart = false
unless Vagrant.has_plugin? plugin
puts "Installing" + plugin + "..."
system "vagrant plugin install #{plugin}"
need_restart = true
end
var Friend = function(name, id, friends, x, y, theta) {
this.d = 5;
this.name = name;
this.id = id;
this.theta = theta;
this.name = name;
this.pos = createVector(x, y, 0);
this.mutual = friends; // Array of ids/names
this.friends = []; // Array of friend instances
};
{"eventType":"didRangeBeaconsInRegion","beacons":[{"major":65215,"minor":38409,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-70,"proximity":"ProximityNear"},{"major":50499,"minor":1311,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-73,"proximity":"ProximityNear"},{"major":28680,"minor":57614,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-86,"proximity":"ProximityNear"},{"major":65523,"minor":5129,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-78,"proximity":"ProximityNear"},{"major":161,"minor":7854,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-74,"proximity":"ProximityNear"},{"major":16258,"minor":63095,"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","rssi":-80,"proximity":"ProximityFar"}],"region":{"uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","identifier":"banana","typeName":"BeaconRegion"}}
[ {
"year": "2016",
"semester": "summer 2",
"start": "2016-06-23",
"end": "2016-07-29"
},
{
"year": "2016",
"semester": "summer 1",
"start": "2016-05-16",
// Douglas Crockford typeOf function
function typeOf(value) {
var s = typeof value;
if (s === 'object') {
if (value) {
if (value instanceof Array) {
s = 'array';
}
} else {