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 measure = (f, sampleSize, ...args) => { | |
const start = Date.now() | |
for (let i = 0; i < sampleSize; i++) f(...args) | |
return (Date.now() - start) / sampleSize | |
} | |
const perfDiff = (value1, value2) => (100 * (value1 - value2)/value1).toFixed(2) + '%' | |
const callback = (_,i) => i |
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
# Based on https://community.spiceworks.com/topic/592770-extract-icon-from-exe-powershell | |
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null | |
[System.Drawing.Icon]::ExtractAssociatedIcon('full-path-to/file.exe').ToBitmap().Save('full-path-to/icon.ico') |
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
# From https://stackoverflow.com/questions/29066742/watch-file-for-changes-and-run-command-with-powershell | |
$folder = "C:\Users\LOCAL_~1\AppData\Local\Temp\3" | |
$filter = "*.log" | |
$destination = "C:\Users\Documents" | |
$Watcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{ | |
IncludeSubdirectories = $false | |
NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' | |
} |
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
#From https://www.deployhq.com/git/faqs/removing-large-files-from-git-history | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch path/to/file' --prune-empty --tag-name-filter cat -- --all |
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
{ | |
"commandline": "%PROGRAMFILES%/Git/bin/bash.exe -i -l", | |
"guid": "{b6dcc215-1356-4b6b-907b-61957457104a}", | |
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico", | |
"name": "Git Bash", | |
"startingDirectory": "%USERPROFILE%/Documents/Git", | |
"tabTitle": "Git Bash" | |
}, | |
{ | |
"commandline": "C:\\Program Files\\nodejs\\node.exe", |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU] | |
"NoAutoRebootWithLoggedOnUsers"=dword:00000000 | |
; "NoAutoRebootWithLoggedOnUsers"=dword:00000001 |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search] | |
"BingSearchEnabled"=dword:00000000 | |
"AllowSearchToUseLocation"=dword:00000000 | |
"CortanaConsent"=dword:00000000 |
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
function cprintf(color, string) | |
%CPRINTF wraps the given string in html that colors that text. | |
disp(['<font color="', color, '">', string, '</font>']); | |
end |
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
function y = isCarmichael(x) | |
y = false | |
if isprime(x) | |
return | |
end | |
for b = 2:x-1 | |
if gcd(b,x) ~= 1; continue; end | |
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
myaddress = '[email protected]'; | |
setpref('Internet','E_mail',myaddress); | |
setpref('Internet','SMTP_Server','smtp.gmail.com'); | |
setpref('Internet','SMTP_Username',myaddress); | |
setpref('Internet','SMTP_Password',mypassword); | |
props = java.lang.System.getProperties; | |
props.setProperty('mail.smtp.auth','true'); | |
props.setProperty('mail.smtp.socketFactory.class', ... |
OlderNewer