Skip to content

Instantly share code, notes, and snippets.

@wx13
Created July 19, 2010 22:14
Show Gist options
  • Save wx13/482125 to your computer and use it in GitHub Desktop.
Save wx13/482125 to your computer and use it in GitHub Desktop.
stuff for creating homework sheets
#!/usr/bin/ruby
require 'date'
weekday = ["Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"]
month = ["", "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October",
"November", "December"]
for day in (1..365)
date = Date.ordinal(y=2009,d=day)
puts weekday[date.wday] + "," + " " + month[date.month] + " " + date.day.to_s
end
#FIG 3.2 Produced by xfig version 3.2.5-alpha5
Portrait
Center
Inches
Letter
100.00
Single
-2
1200 2
0 32 #000000
6 1050 3150 9900 5025
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8519 4800 9785 4800
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8116 4050 9785 4050
2 2 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 5
1050 3195 9900 3195 9900 5025 1050 5025 1050 3195
4 0 0 50 -1 12 17 0.0000 4 158 475 7454 4050 Due\001
4 0 0 50 -1 12 17 0.0000 4 173 2533 5655 4800 Teacher initials\001
-6
6 1050 9225 9900 11100
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8519 10875 9785 10875
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8116 10125 9785 10125
2 2 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 5
1050 9270 9900 9270 9900 11100 1050 11100 1050 9270
4 0 0 50 -1 12 17 0.0000 4 158 475 7454 10125 Due\001
4 0 0 50 -1 12 17 0.0000 4 173 2533 5655 10875 Teacher initials\001
-6
6 1050 7200 9900 9075
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8519 8850 9785 8850
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8116 8100 9785 8100
2 2 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 5
1050 7245 9900 7245 9900 9075 1050 9075 1050 7245
4 0 0 50 -1 12 17 0.0000 4 158 475 7454 8100 Due\001
4 0 0 50 -1 12 17 0.0000 4 173 2533 5655 8850 Teacher initials\001
-6
6 1050 5175 9900 7050
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8519 6825 9785 6825
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8116 6075 9785 6075
2 2 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 5
1050 5220 9900 5220 9900 7050 1050 7050 1050 5220
4 0 0 50 -1 12 17 0.0000 4 158 475 7454 6075 Due\001
4 0 0 50 -1 12 17 0.0000 4 173 2533 5655 6825 Teacher initials\001
-6
6 1050 1050 9900 2925
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8519 2700 9785 2700
2 1 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 2
8116 1950 9785 1950
2 2 0 1 0 7 50 -1 -1 3.000 0 0 7 0 0 5
1050 1095 9900 1095 9900 2925 1050 2925 1050 1095
4 0 0 50 -1 12 17 0.0000 4 158 475 7454 1950 Due\001
4 0 0 50 -1 12 17 0.0000 4 173 2533 5655 2700 Teacher initials\001
-6
6 7725 1200 9825 1425
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
9600 1425 9825 1425 9825 1200 9600 1200 9600 1425
4 0 0 50 -1 12 18 0.0000 4 180 1815 7725 1425 No homework\001
-6
6 7725 3300 9825 3525
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
9600 3525 9825 3525 9825 3300 9600 3300 9600 3525
4 0 0 50 -1 12 18 0.0000 4 180 1815 7725 3525 No homework\001
-6
6 7725 5325 9825 5550
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
9600 5550 9825 5550 9825 5325 9600 5325 9600 5550
4 0 0 50 -1 12 18 0.0000 4 180 1815 7725 5550 No homework\001
-6
6 7725 7350 9825 7575
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
9600 7575 9825 7575 9825 7350 9600 7350 9600 7575
4 0 0 50 -1 12 18 0.0000 4 180 1815 7725 7575 No homework\001
-6
2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2
1125 12900 9825 12900
2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2
1125 12375 9825 12375
2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 0 0 2
1125 11850 9825 11850
4 0 0 50 -1 12 18 0.0000 4 180 3960 5850 600 Homework\001
4 0 0 50 -1 14 18 0.0000 4 180 1650 1050 600 123date123\001
4 0 0 50 -1 12 18 0.0000 4 255 5115 1125 11550 Notes (to/from teacher/parent):\001
4 0 0 50 -1 14 18 0.0000 4 180 825 1125 7500 Music\001
4 0 0 50 -1 14 18 0.0000 4 180 1650 1125 5475 Humanities\001
4 0 0 50 -1 14 18 0.0000 4 180 1155 1125 3450 Science\001
4 0 0 50 -1 14 18 0.0000 4 180 660 1125 1350 Math\001
ruby days.rb > days.list
mkdir -p max_hw_files
n=0
while read line
do
if [ $n -lt 10 ]
then
nn="00$n"
elif [ $n -lt 100 ]
then
nn="0$n"
else
nn="$n"
fi
sed "s/123date123/$line/" max_hw.ps > max_hw_files/max_hw_$nn.ps
n=$((n+1))
done < days.list
psmerge -omax_hw_all.ps max_hw_files/*.ps
ps2pdf max_hw_all.ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment