View code-cat.js
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 hljs = require('highlight.js'); | |
var high = hljs.highlight('cpp', 'void main<>(){return true;}').value; | |
high = high.replace(/<\/span>/g,'\x1b[0m'); | |
high = high.replace(/<span class="([a-z]+)">/g,function (match,p1) { | |
return { | |
'keyword':'\x1b[32m', | |
'types':'\x1b[34m', | |
'number':'\x1b[33m', | |
'consts':'\x1b[37m' | |
}[p1]; |
View rainbow.js
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
c = [41,43,42,46,44,45,41]; | |
var rainbow = ''; | |
for(var i=0; i<6;i++) { | |
rainbow += '\x1B['+c[i]+'m'; | |
rainbow += '\x1B['+(c[i+1]-10)+'m'; | |
rainbow += ' '; | |
rainbow += '\x1B['+c[i]+'m'; | |
rainbow += '\x1B['+(c[i+1]-10)+'m'; | |
rainbow += '░'; | |
rainbow += '\x1B['+c[i+1]+'m'; |
View keydown.js
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
.directive('onKeydown', ['$parse',function($parse) { | |
return function(scope, elm, attrs) { | |
var keydownFn = $parse(attrs.onKeydown); | |
elm.bind("keydown", function(event) { | |
scope.$apply(function(){ | |
keydownFn(scope, { '$event': event }); | |
}); | |
}); | |
}; | |
}]); |
View comment-precompiler.c
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
/* | |
code1(); | |
/*/ | |
code2(); | |
/**/ | |
add a slash to flip the switch | |
//* | |
code1(); |
View .js.bat
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
rem = 'by valerij primachenko';/* | |
node %0 | |
pause | |
exit | |
*/ | |
require('node_magic'); |