Отладка SmartTV больная тема для большинства разработчиков. Мысли о том, что придется делать все в слепую отталкивают разработчиков, что негативно влияет на отрасль SmartTV и Web в целом. Я рассказажу, что не все так плохо и инструменты существуют. А те, которых нет не сложно запилить самому.
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
# oh-my-zsh Theme | |
# Default robbyrussell theme with node version info. | |
# Installation: place this file in .oh-my-zsh/custom/themes/robbyrussell.zsh_theme | |
function node_prompt_version { | |
if which node &> /dev/null; then | |
echo "%{$fg_bold[blue]%}node(%{$fg[red]%}$(node -v)%{$fg[blue]%}) %{$reset_color%}" | |
fi | |
} |
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
/** | |
* Returns a Promise which resolves with a value in form of a tuple. | |
* @param promiseFn A Promise to resolve as a tuple. | |
* @returns Promise A Promise which resolves to a tuple of [error, ...results] | |
*/ | |
export function tuple (promise) { | |
return promise | |
.then((...results) => [null, ...results]) | |
.catch(error => [error]) | |
} |
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
How to set up auto filesystem expansion for custom PI images | |
============================================================ | |
Preamble | |
======== | |
When a custom pi image is created, it is a good idea to expand the FS so that all the space on the SD card is used. This is done manaully using the raspi-config tool or raspi-config --expand-rootfs. | |
The official pi images expand the FS automatically so it would be nice to replicate this process for custom images. | |
The procedure below shows how to do this. | |
Procedure |
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
sdb connect <ip>:<port> # connect to TV | |
sdb -s <deviceName> capability # get <installationPath> | |
# build | |
tizen cli-config "default.profiles.path=<profile_path>" | |
tizen build-web -out .buildResult -- <source-dir> | |
tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file> | |
mv <package-file> . | |
rm -rf <source-dir>/.buildResult |
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 socket = io.connect('http://HOSTNAME:8080'); | |
socket.on('reload', function (data) { | |
location.reload(); | |
}); | |
/* | |
socket.on('eval', function(data) { | |
eval(data.evalString); | |
}); |
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
// vanilla JS window width and height | |
var w=window, | |
d=document, | |
e=d.documentElement, | |
g=d.getElementsByTagName('body')[0], | |
x=w.innerWidth||e.clientWidth||g.clientWidth, | |
y=w.innerHeight||e.clientHeight||g.clientHeight; |