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
// relatively safe | |
function formatSafely(num, digits) { | |
return (Array(digits).join('0') + Math.floor(num)).substr(-digits); | |
} | |
// or quick | |
function formatQuickly(num, digits) { | |
return (Array(digits).join('0') + num).substr(-digits); | |
} |
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
/** | |
* A test using regular expression for lexing | |
* by vilicvane<https://vilic.github.io/> | |
* | |
* It turns out to be 50% faster comparing to original Angular lexer before JIT Compilation, but 50% slower then (in Chrome). | |
* And only 1/3 of the original lexer counting the core code lines. | |
* Though it's because the regular expressions are doing most of the work. | |
* | |
* Note: The regular expression and related enum declaration are managed by https://github.com/vilic/regex-tools/. | |
*/ |
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
var ChildProcess = require('child_process'); | |
var task = process.argv[2]; | |
var cargo = ChildProcess.exec('cargo ' + task); | |
cargo.stdout.on('data', function (data) { | |
process.stdout.write(data); | |
}); |
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
/* | |
Server IP Information Utils | |
by VILIC VANE <https://github.com/vilic> | |
MIT License | |
*/ | |
import * as OS from 'os'; | |
export interface IPInfo { | |
lanIP: string; |
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
<body></body> | |
<script> | |
try{ | |
var w=20, h=20; | |
var s=10; | |
var t=2500; | |
var sl=5; | |
var lx=1, ly=0; | |
var ax=1, ay=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
{ | |
"window.zoomLevel": -0.5, | |
"editor.insertSpaces": true, | |
"editor.folding": false, | |
"files.autoSave": "afterDelay", | |
"files.trimTrailingWhitespace": true, | |
"files.eol": "\n", |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink] | |
"MingLiU"=hex(7):4d,00,49,00,43,00,52,00,4f,00,53,00,53,00,2e,00,54,00,54,00,\ | |
46,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,53,\ | |
00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,2c,00,34,00,30,00,\ | |
2c,00,34,00,38,00,00,00,4d,00,49,00,43,00,52,00,4f,00,53,00,53,00,2e,00,54,\ | |
00,54,00,46,00,2c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,\ | |
20,00,53,00,61,00,6e,00,73,00,20,00,53,00,65,00,72,00,69,00,66,00,00,00,53,\ | |
00,49,00,4d,00,53,00,55,00,4e,00,2e,00,54,00,54,00,43,00,2c,00,53,00,69,00,\ |
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
/* http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clike+javascript+aspnet+c+csharp+cpp+css-extras+handlebars+java+json+less+typescript */ | |
/** | |
* prism.js Twilight theme | |
* Based (more or less) on the Twilight theme originally of Textmate fame. | |
* @author Remy Bach | |
*/ | |
code[class*="language-"], | |
pre[class*="language-"] { | |
color: white; | |
background: none; |
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
import { | |
Directive, | |
EmbeddedViewRef, | |
Input, | |
OnInit, | |
TemplateRef, | |
ViewContainerRef, | |
} from '@angular/core'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; |
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
# Save this file as $PROFILE (run `echo $PROFILE` in powershell) | |
Set-Alias gh Get-Help; | |
Set-Alias cd Push-Location -Option AllScope; | |
Set-Alias cdb Pop-Location -Option AllScope; | |
Set-PSReadLineOption -HistoryNoDuplicates; | |
# For `cdp` (cd project) | |
$ProjectDirectory = 'C:\Projects'; |
OlderNewer