(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
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 makeReadable(bytes) { | |
var readable = "", i; | |
for (i = 0; i < bytes.length; i++) { | |
var byteVal = bytes.charCodeAt(i); | |
if (byteVal < 32 || byteVal > 127) { | |
readable += "\\x" + ("0" + byteVal.toString(16).toUpperCase()).slice(-2); | |
} else { | |
readable += bytes[i]; | |
} | |
} |
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
// Convert 0-255 to hex byte: | |
String.fromCharCode(id) | |
// Convert 01-FF to hex byte: | |
String.fromCharCode(parseInt(id, 16)) | |
// Convert hex byte to 0-ff: | |
id.charCodeAt(0).toString(16); | |
// Convert hex byte to 00-FF: |
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
CF.userMain = function(){ | |
CF.watch(CF.JoinChangeEvent, "s19", doAppend) //this is the join in the iViewer SIMPL module, declare it in a page you never flip to | |
} | |
var appended = "" | |
function doAppend(join, value, tokens){ | |
var regex = /\xFE\x02/; | |
if (regex.test(value)) { | |
appended += value.slice(2, value.length); |
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
/* Basic Command Queuing for CommandFusion | |
USAGE: | |
- First step: Replace the "SYSTEM NAME GOES HERE" text towards the end of the script with your actual system name as defined in the System Manager of your GUI project | |
- Next: Save this script into a .js file and add it to your GUI project via Project Properties > Script Manager. | |
- Ensure you are using iViewer4 (NOT CF iViewer, legacy product without JavaScript support) | |
- within button properties, add a JavaScript call such as: | |
CommandQueue.startCommand("StartDataGoesHere"); |
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
/* | |
NOTE: Change "System Name" and "Feedback Name" to the correct info for your project first. | |
NOTE: Change "d1" to the digital join number of your power button. | |
NOTE: on your power button, set the javascript to: togglePower(); | |
*/ | |
var powerState = 0; | |
var powerStateRegex = /\x21\x01\x00\x00\x01(\x00|\x01)\x0D/; |
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 baseURL = "www.someurl.com"; | |
var theURL = "/some/url?param=test"; | |
var headerString = "\ | |
PUT "+theURL+" HTTP/1.1\r\n\ | |
Host: "+baseURL+"\r\n\ | |
Accept-Encoding: gzip, deflate\r\n\ | |
Content-Type: text/xml\r\n\ | |
Content-Length: "; |
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
import time | |
import socket | |
import base64 | |
src = '192.168.1.2' # ip of remote | |
mac = '00-AB-11-11-11-11' # mac of remote | |
remote = 'python remote' # remote name | |
dst = '192.168.1.3' # ip of tv | |
app = 'python' # iphone..iapp.samsung |
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
[ | |
['00-00-00', 'XEROX CORPORATION'], | |
['00-00-01', 'XEROX CORPORATION'], | |
['00-00-02', 'XEROX CORPORATION'], | |
['00-00-03', 'XEROX CORPORATION'], | |
['00-00-04', 'XEROX CORPORATION'], | |
['00-00-05', 'XEROX CORPORATION'], | |
['00-00-06', 'XEROX CORPORATION'], | |
['00-00-07', 'XEROX CORPORATION'], | |
['00-00-08', 'XEROX CORPORATION'], |