This file contains 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
/* Piece of server.js code */ | |
/* https://github.com/coderaiser/cloudcmd/blob/44e96a63de3414cc71073f25c08588f6ed10cf2b/server.js */ | |
/* создаём сервер на порту 31337 */ | |
CloudServer.start=function() | |
{ | |
CloudServer.init(); | |
/* constant ports of deployng servers */ | |
var lCloudFoundryPort = process.env.VCAP_APP_PORT; |
This file contains 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
/* turns first found textArea - looks like CodeMirror editor */ | |
var editor; | |
function setStyle(){ | |
var element= document.createElement('style'); | |
element.media='screen'; | |
element.type='text/css'; | |
element.innerText='@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);'+ | |
'.CodeMirror{'+ | |
'font-family:\'Droid Sans Mono\';'+ | |
'font-size:15px;'+ |
This file contains 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
/* removing keyBinding if set */ | |
CloudCommander.keyBinded = false; | |
var editor; | |
left.className = 'panel hidden'; | |
function setStyle(){ | |
var element= document.createElement('style'); | |
element.media='screen'; | |
element.type='text/css'; |
This file contains 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 CloudCommander; | |
CloudCommander.Editor = { CloudMirror: undefined }; | |
CloudCommander.Editor.CloudMirror = { load: (function(){ | |
CloudCommander.jsload('http://codemirror.net/lib/codemirror.js', load_all(this)); | |
function load_all(pParent) { | |
return function(){ | |
CloudCommander.cssLoad({ | |
src : 'http://codemirror.net/lib/codemirror.css', |
This file contains 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
ace_editor.textContent = ace_editor.textContent.replace('font-size: 12px;','font-size: 15px;'); |
This file contains 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
/* Add bookmark with this link | |
* on web page would be dragable and you can | |
* drag it to desktop | |
*/ | |
javascript:for(var lLinks=document.getElementsByTagName("a"),i=0;i<lLinks.length;i++)lLinks[i].ondragstart=function(a){lElement=a.target;a.dataTransfer.setData("DownloadURL","application/octet-stream:"+lElement.textContent+".html:"+lElement.href)}; |
This file contains 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
/* | |
spead result | |
1198 | |
1162 | |
1189 | |
*/ | |
DOM.anyLoadOnload = function(pParams_a, pFunc){ | |
if( this.isArray(pParams_a) ) { | |
var lParam = pParams_a.pop(); | |
This file contains 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
/* c9.io kill active node process */ | |
(function(){ | |
"use strict"; | |
var exec = require('child_process').exec, | |
lCmd = 'kill -9' + ' ' + /* kill finded process */ | |
'`ps ax' + '|' + /* show all process */ | |
'grep node-openshift' + '|' + /* find node-openshift */ | |
'grep -v grep' + '|' + /* exlude grep command */ |
This file contains 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
# print finded process | |
ProcessList=`ps ax|grep node-openshift` | |
echo $ProcessList | |
# getting pid of process | |
PID=`echo "${ProcessList}"|grep -v grep|awk '{print $1}'` | |
echo $PID | |
#kill it | |
if test ! $PID | |
then echo 'process not found' | |
else kill -9 $PID && echo 'killed process' |
This file contains 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
/* | |
* пример использования WebRTC | |
* http://rastacoding.kodingen.com/webrtc | |
*/ | |
(function(){ | |
'use strict' | |
/* определяем вариант функции getUserMedia в зависимости от браузера */ | |
navigator.getUserMedia = navigator.getUserMedia || /* версия, которая останется */ | |
navigator.webkitGetUserMedia || /* chrome и safari */ |
OlderNewer