This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This project is an Arduino that serves as a CAN relay to a Raspberry Pi. | |
* It was created because of this issue https://github.com/linux-can/can-utils/issues/133 | |
* The Arduino is responsible for sending/receiving CAN messages and passes it along over Serial. | |
* | |
* We used a custom library for this, that is where the CAN class comes from, but you can replace it with whatever CAN library | |
* you want to use. | |
*/ | |
#include "config.h" | |
#include "pins.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Left shift operator for Base64Decode (Inno Setup does not support << ) | |
function BitwiseLeftShift (input: LongInt; shiftFactor: Integer): LongInt; | |
var | |
exp: LongInt; // Total to multiply by | |
i: Integer; | |
//Result: LongInt; | |
begin | |
Result := 0; | |
exp := 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ShowAutocompletion(obj) { | |
// Disable default autocompletion for javascript | |
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ noLib: true }); | |
// Helper function to return the monaco completion item type of a thing | |
function getType(thing, isMember) { | |
isMember = (isMember == undefined) ? (typeof isMember == "boolean") ? isMember : false : false; // Give isMember a default value of false | |
switch ((typeof thing).toLowerCase()) { | |
case "object": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ClassList polyfill for IE7+ and all major browsers | |
* By: Michael Rouse | |
* | |
* Use: | |
* var my_element = document.getElementById('major-id'); | |
* | |
* classList.add(my_element, 'new-class'); // Adds the class 'new-class' to the element | |
* classList.remove(my_element, 'old-class'); // Removes 'old-class' from the element's classes | |
* classList.contains(my_element, 'a-class'); // Returns true if the element has 'a-class' as a class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Event polyfill | |
* Michael Rouse | |
* December 2016 | |
*/ | |
function polyfillEvent(e) { | |
e = e || window.event; | |
e.eventPhase = e.eventPhase || 0; | |
e.defaultPrevented = e.defaultPrevented || false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>File Input</title> | |
</head> | |
<body> | |
<input type="file" id="fileInput"> | |
<script src="index.js"></script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Right Pad | |
* | |
* str - the string to pad | |
* chr - the character to use as padding | |
* n - the desired string length | |
*/ | |
function rpad(str, chr, n) | |
{ | |
return ((str+='').length < n && chr) ? rpad(str + chr, chr, n) : str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var questions = { | |
0: { | |
name: "name", | |
intro: true, | |
question: ["Hi.", "I'm Jordan Staniscia", "Might I ask what your name is?"], | |
answers: { | |
"default": { | |
replies: ["That's a good name.", "Names are a funny thing", "It's one of the only decisions you don't make yourself"] | |
}, | |
"jordan staniscia": { |