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
@goto BEGINNING_OF_CMD | |
# -*- coding: UTF-8 -*- | |
""" | |
:BEGINNING_OF_CMD | |
@echo off | |
cd /d "%~dp0" | |
set PYTHON=python.exe | |
%PYTHON% -c "import ctypes, sys, ctypes.wintypes; ctypes.windll.shell32.IsUserAnAdmin.restype = ctypes.wintypes.BOOL; sys.exit(ctypes.windll.shell32.IsUserAnAdmin())" | |
if ERRORLEVEL 2 goto :ERROR | |
if ERRORLEVEL 1 goto :ADMIN |
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
@goto RUN_PYTHON | |
# -*- coding: UTF-8 -*- | |
""" | |
:RUN_PYTHON | |
@echo off | |
cd /d "%~dp0" | |
python -x -i "%~nx0" | |
exit /b %ERRORLEVEL% | |
""" |
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
<script id="ruby_script" type="text/ruby"> | |
#<![CDATA[ | |
num = 0 | |
1000.times do |i| | |
num += i | |
end | |
hash = { result: num, input: $input } # $input has JavaScript function. | |
hash[:input].call({ a: num }) # JS function is called. | |
$result = hash[:result] | |
# ]]> |