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
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof | |
<# | |
これで下記の hoge.ps1 が起動します。 | |
または下記を消して、その行から PowerShell スクリプトをべた書きでもおk | |
#> | |
. .\hoge.ps1 |
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
#!/bin/bash | |
failed() | |
{ | |
echo $1 1>&2 | |
exit 1 | |
} | |
usage() | |
{ | |
failed "Usage: sudo $0 -l <runlevel> -o <start|stop>" |
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
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof | |
Set-StrictMode -Version 2.0 | |
# OS およびバージョン検証 (使用可能な OS は Windows7 または 8.1 の x86 または x64 のみ) | |
$os = [System.Environment]::OSVersion | |
if ($os.Platform -ne [System.PlatformID]::Win32NT) { throw "Detected the OS type that is not supported. This installer requires Windows 7 (x86 or x64) or upper version." } | |
$wver = $os.Version | |
if ($wver.Major -lt 6 -or $wver.Minor -lt 1) { throw "Detected the OS version that is not supported. This installer requires Windows 7 (x86 or x64) or upper version." } | |
if ($wver.Major -eq 6 -and $wver.Minor -eq 2) { throw "Windows 8 should be upgraded to 8.1 before this installation." } |
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
@echo off | |
rem USAGE: exec_more_win7 [command: run on Windows7-10] [args for command] | |
rem ERRORLEVEL: 0: >= Win7, 1: < Win7 | |
rem EXAMPLE 1: call exec_more_win7 | |
rem EXAMPLE 2: exec_more_win7 msiexec /i installer4win7.msi /qn | |
rem Windows Vista (NT 6.0) | |
ver | find "Version 6.0" > nul | |
if not errorlevel 1 goto VISTA |
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
@echo off | |
rem USAGE: confirm [command: run if confirmed] [args for command] | |
rem ERRORLEVEL: 0: confirmed, 1: declined | |
rem EXAMPLE 1: call confirm | |
rem EXAMPLE 2: confirm msiexec /i foo.msi /qn | |
setlocal | |
echo Are you sure you want to run? [y/N] | |
set /P confirm="" |
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
@echo off | |
whoami /groups | Find "High Mandatory Level" > NUL | |
if not errorlevel 1 goto RUN | |
powershell -Command Start-Process -Verb runas "%0" | |
exit /b %errorlevel% | |
:RUN | |
powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 9})-join\"`n\");&$s" %* | |
exit /b 0 | |
Set-StrictMode -Version 2.0 |
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
let サーバル x = sprintf "きみは%sなフレンズなんだね!" x | |
let あかり x = sprintf "わぁい%sあかり%sだいすき!" x x | |
let Mixed x = サーバル (あかり (サーバル (あかり x))) | |
[<EntryPoint>] | |
let main argv = | |
printfn "%A" (Mixed "カバンちゃん") | |
0 | |
// Question: https://twitter.com/danmaq/status/828743554574880768 |
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
const re = /(\.)(.*)\1+/; | |
const replace = s => s.match(re) ? replace(s.replace(re, '$1$2')) : s; |
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
#!/usr/bin/perl -w | |
use IO::File; #####################< MY BODY WIDTH EQUALS THE ASCII CODE. >######################### | |
my $hello_txt = IO::File->new(__FILE__, O_RDONLY); ######################################################## | |
foreach ($hello_txt->getlines()) ########################################################################## | |
{ ############################################################################################################ | |
my $length = length; ###### | |
my $character = chr $length; ##################################################### | |
print $character; ######################################################################################## | |
} ############################################################################################################### | |
$hello_txt->close(); ###################################################################################### |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundBlur</key> | |
<real>0.049349713962891201</real> | |
<key>BackgroundColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T |
OlderNewer