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
@set args=%* | |
@powershell "iex( (@('','','')+(cat '%~f0'|select -skip 3))-join[char]10)" | |
@exit /b %ERRORLEVEL% | |
$std_cell_width = 1.50 | |
function Split-LikeShell($s){ | |
$rx = [regex]'"[^"]*"' | |
while( $true ){ | |
$m = $rx.Match($s) |
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
@set args=%* | |
@powershell "iex ((@('')*3+(cat '%~f0' | select -skip 3))-join [char]10)" | |
@exit /b %ERRORLEVEL% | |
function Byte2DWord($a,$b,$c,$d){ | |
return ($a+256*($b+256*($c+256*$d))) | |
} | |
function Get-Bits($path){ | |
$bin = [System.IO.File]::ReadAllBytes($path) |
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
@echo off | |
for %%I in ( | |
"%windir%" | |
"%windir%\system32" | |
) do pushd %%I & call :sum & popd | |
exit /b | |
:sum | |
echo. | |
echo ******************** %CD% ************************* |
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
for /D %%I in (C:\Windows\Microsoft.NET\Framework\v*) do set "MSBUILD=%%I\MSBuild.exe" | |
"%MSBUILD%" xxxxxxx.sln /p:Configuration=%1 |
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
Module Module1 | |
Sub Main() | |
Dim foo As String = Nothing | |
Dim bar As String = CStr(foo) | |
Console.Write("CStr(Nothing)={0}", If(bar, "(null)")) | |
Console.ReadLine() | |
End Sub | |
End Module |
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
# $today = Get-Date -Format "yyyy-MM-dd" | |
$done = @{} | |
Join-Path $env:appdata 'NYAOS_ORG\nyagos.history' | | |
%{ Get-Content $_ -Encoding utf8 } | | |
?{ $_ -match '^[g]it commit' } | | |
%{ | |
$private:tmp=($_ -split "`t") | |
# $private:from = (Get-Date).AddDays(-3).ToString("yyyy-MM-dd") | |
$private:dir=$tmp[1] | |
if( (Test-Path $dir) -and (-not $done.ContainsKey($dir)) ){ |
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
@setlocal | |
@if not "%1" == "" @set "ARG=/c %*" | |
powershell "(New-Object -Com Shell.Application).ShellExecute('cmd',$Env:ARG,'','runas')" | |
@endlocal |
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
@echo off | |
setlocal | |
set "TWEET=%TEMP%\tweet.txt" | |
type nul > "%TWEET%" | |
gvim -c "e ++enc=utf8" "%TWEET%" | |
if errorlevel 1 exit /b | |
for %%I in (%TWEET%) do if %%~zI LEQ 1 exit /b | |
twty -ff "%TWEET%" | |
endlocal |
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
$ cat foo.c | |
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
int zero=0; | |
puts( zero > strlen("")-1 ? "true" : "false"); | |
return 0; | |
} |
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
for /F "skip=2 tokens=2*" %%I in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\%1" /ve') do echo %%J |