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
void Main() | |
{ | |
// LinqPad script that downloads all PDFs/etc from Bret Victors worry dream refs page. | |
var targetPath = @"PATH_TO_WHERE_YOU_KEEP_YOUR_EBOOK\eBooks"; | |
//These filenames were extracted from http://worrydream.com/refs/ -- using NimbleText. | |
//(TODO: Use regex or html agility pack to find them programmatically) | |
var refs = new string[] { | |
"Hamming-TheArtOfDoingScienceAndEngineering.pdf", | |
"Licklider-IntergalacticNetwork.pdf", |
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
using System; | |
namespace Quine | |
{ | |
class Program | |
{ | |
static string[] program = new string[] { | |
"using System;", | |
"namespace Quine", | |
"{", | |
" class Program", |
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
dir *.md | % { $file = $_.Name; get-content $_ | select-string -pattern "//TODO:" | % { $file.substring(0,10) + ":" + $_.ToString().replace("//TODO:","").trim() }} | more |
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
pandoc -f markdown -t epub --epub-cover-image=cover.jpg -o yfp.epub --smart --toc --epub-stylesheet=epub.css title.txt .\00_Title.md .\01_Before_we_begin.md .\02_ideas.md .\03_Choose_your_concept.md .\04_Landing_page.md .\05_Pricing.md .\06_Build_your_product.md .\07_Launch_time.md .\08_Optimize.md .\09_Support.md .\10_Refresh.md .\11_tools.md .\12_Glossary.md .\13_reading_list.md --epub-chapter-level=3 |
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
$totalWords = 0 | |
$totalTodo = 0; | |
dir *.md | % { | |
$name = $_.Name; | |
$len = $_.length; | |
$todos = (get-content $_ | select-string -pattern "//TODO:").length | |
$subChapters = (get-content $_ | select-string -pattern "^### ").length | |
$words = (get-content $_ | measure-object -word).Words; | |
$totalWords = $totalWords + $words; |
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
$x = ""; | |
dir *.md | % { $x = $_.Name; type $_.Name | Measure-Object –Word | % { ("{0,5}" -f $_.Words) + " " + $x } } | sort -desc |
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
# draw a bar (in the console) of a given size, n | |
function bar($n) { | |
$co = "green"; | |
if ($n -lt 100) { | |
$co = "red"; #less than 100%: is RED | |
} elseif ($n -ge 500) { | |
$co = "blue"; #greater than 500% is Blue | |
} | |
1..([system.math]::min(50,$n/10)) | % { barbit($co);} |
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
Get-Content *.md | Measure-Object –Word | % { $count = $_.Words } | |
hg add | |
$message = "words: " + $count | |
$todo = (get-content .\todo.txt | select-string -pattern "[_]").length | |
$done = (get-content .\todo.txt | select-string -pattern "[x]").length | |
$message = $message + ", tasks: " + $done + "/" + ($todo + $done) + "" | |
hg commit -m $message | |
& .\progress.ps1 |
NewerOlder