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
ls | ? {$_.GetType().ToString() -match 'FileInfo'} | % {$yr = $_.CreationTime.Year; if (-not (Test-Path $yr)){ mkdir $yr}; mv $_ $yr} |
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
wmctrl -a emacs |
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
$r = New-Object System.Random | |
$r.NextDouble() * 10000000000 |
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
DISM /online /Cleanup-Image /SpSuperseded |
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
This assumes you've already created a github account. | |
So, you've created something new and wonderful on your local machine and you want to preserve it into github. | |
On github, create a repository (with license and readme). | |
On your local machine: | |
cd <yourWorkingDirectory> # The root of the Wonderful Thing you created | |
# (You might want to create a .gitignore file here, but you don't have to.) |
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
/* | |
* I like the Atom Light syntax theme, but the comment color is too light for me to comfortably large block comments | |
* (i.e., DOCUMENTATION), which, you know, some of us like to actually READ. So, this is a quick-n-dirty hack to make | |
* the comment color mo betta. Add this to your styles.less file (you can find it by hitting the "Open Config Folder" | |
* button in the Settings view.) | |
*/ | |
atom-text-editor::shadow .comment { | |
color: #778877; | |
} |
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
$(curl -uri https://rubygems.org/gems/jekyll-feed).Headers | ft -auto -wrap | |
<# | |
$(cmd) is PowerShell's equivalent of bash's backtick command interpolation (`cmd`). | |
"curl" is a built-in alias for Invoke-WebRequest. | |
The result of $(cmd) is an object (PowerShell pipes objects, not text), so | |
".Headers" selects that object property. | |
The Headers property is a dictionary, so we feed that into Format-Table (built-in alias "ft"), | |
specifying auto-width and text-wrapping. | |
#> |
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
$stringToBeHashed = "[email protected]" | |
$md5Hash = [Security.Cryptography.MD5]::Create() | |
$hashBytes = $md5Hash.ComputeHash($stringToBeHashed.ToCharArray()) | |
$hashString = "" | |
foreach ($b in $hashBytes) { $hashString = $hashString + $b.ToString("x2")} | |
$hashString | |
# http://www.gravatar.com/avatar/cd0858865a889264c5d383a0abca2eaf?d=identicon |
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
<# | |
.SYNOPSIS | |
Topological sort of dependency graph (or any DAG) | |
.INPUTS | |
List of lists of objects (or strings). Each inner list consists of an object (the head of the list) and other | |
objects ON WHICH it depends. Thing A "depends" on Thing B if Thing B must be processed before Thing A. | |
.OUTPUTS | |
List of input objects sorted in such a way that objects that don't depend on anything occur before objects which | |
depend on them. (You could consider that to be a reverse-topological sort.) | |
.EXAMPLE |
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
import System.IO | |
main = do | |
inText <- getContents | |
let inWords = words inText | |
result <- f ( read (inWords !! 0) :: Int) | |
putStrLn result | |
f :: Int -> IO String | |
f x = do |
OlderNewer