Skip to content

Instantly share code, notes, and snippets.

Avatar

Bret Davidson bretdavidson

  • North Carolina State University Libraries
View GitHub Profile
View JSLint Options Descriptions
anon true, if the space may be omitted in anonymous function declarations
bitwise true, if bitwise operators should be allowed
browser true, if the standard browser globals should be predefined
cap true, if upper case HTML should be allowed
continue true, if the continuation statement should be tolerated
css true, if CSS workarounds should be tolerated
debug true, if debugger statements should be allowed
devel true, if logging should be allowed (console, alert, etc.)
eqeq true, if == should be allowed
es5 true, if ES5 syntax should be allowed
@bretdavidson
bretdavidson / difference.js
Last active Jun 12, 2017
Possible Interview Questions
View difference.js
// Remove elements of second array from the first array
// Ex. 1 JavaScript Filter (no IE 8 support)
var arr1 = ['A', 'B', 'C', 'D', 'E', 'F'],
arr2 = ['C', 'E', 'F'],
filteredArray;
filteredArray = arr1.filter(function(e, i) {
return !(arr2.indexOf(e) > -1);
});
View reading_list.md
@bretdavidson
bretdavidson / error.txt
Created Mar 11, 2017
conda build r-plotly error
View error.txt
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
View bar chart scratch
var ann,
bar,
chart,
g,
gBar,
gEnter,
gRule,
line,
rects,
rule,
View test
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
View quotes.js
Handlebars.registerHelper('quotify', function (string) {
var string = string.replace(/[\u2018\u2019]/g, "'").replace(/[\u201C\u201D]/g, '"');
return string;
});
You can’t perform that action at this time.