1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,19 +0,0 @@ |
1 |
-layout: default |
|
2 |
-<div id="content"> |
|
3 |
- <div class="post"> |
|
4 |
- <h1 class="post-title">{{ page.month | date_to_month }} {{ page.year }}</h1> |
|
5 |
- <p class="lead">Posts from {{ page.month | date_to_month }}, {{ page.year }}</p> |
|
6 |
- <ul> |
|
7 |
- {% for d in (1..31) reversed %} |
|
8 |
- {% if page.collated_posts[page.year][page.month][d] %} |
|
9 |
- {% for p in page.collated_posts[page.year][page.month][d] reversed %} |
|
10 |
- <li><a href='{{ p.url }}'>{{ p.title }}</a></li> |
|
11 |
- {% endfor %} |
|
12 |
- {% endif %} |
|
13 |
- {% endfor %} |
|
14 |
- </ul> |
|
15 |
- </div> |
|
16 |
-</div> |
|
17 |
- |
18 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,25 +0,0 @@ |
1 |
-layout: default |
|
2 |
-<div id="content"> |
|
3 |
- <div class="post"> |
|
4 |
- <h1 class="post-title">{{ page.year }}</h1> |
|
5 |
- <p class="lead">Posts from the year {{ page.year }}</p> |
|
6 |
- {% for m in (1..12) reversed %} |
|
7 |
- {% if page.collated_posts[page.year][m] %} |
|
8 |
- <h3>{{ m | date_to_month }}</h3> |
|
9 |
- {% for d in (1..31) reversed %} |
|
10 |
- {% if page.collated_posts[page.year][m][d] %} |
|
11 |
- {% for p in page.collated_posts[page.year][m][d] reversed %} |
|
12 |
- <div> |
|
13 |
- <strong>{{ p.date | date: "%d" }}</strong> |
|
14 |
- <a href='{{ p.url }}'>{{ p.title }}</a> |
|
15 |
- </div> |
|
16 |
- {% endfor %} |
|
17 |
- {% endif %} |
|
18 |
- {% endfor %} |
|
19 |
- {% endif %} |
|
20 |
- {% endfor %} |
|
21 |
- </div> |
|
22 |
-</div> |
|
23 |
- |
24 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,16 +0,0 @@ |
1 |
-title: Hello World! I'm Octopress! |
|
2 |
-layout: post |
|
3 |
-updated: March 10th, 2010 |
|
4 |
- |
|
5 |
-**Octopress is a blogging framework designed for hackers**, based on [Jekyll](http://github.com/mojombo/jekyll) the blog aware static site generator powering [Github pages](http://pages.github.com/). |
|
6 |
-If you don't know what Jekyll is, [Jack Moffitt](http://metajack.im/2009/01/23/blogging-with-git-emacs-and-jekyll/) wrote a good summary: |
|
7 |
- |
|
8 |
-{% blockquote Jack Moffitt http://metajack.im/2009/01/23/blogging-with-git-emacs-and-jekyll/ Blogging with Git Emacs and Jekyll %} |
|
9 |
- Jekyll is a static blog generator; it transforms a directory of input files into another directory of files suitable for a blog. The management of the blog is handled by standard, familiar tools like creating and renaming files, the text editor of your choice, and version control. |
|
10 |
-{% endblockquote %} |
|
11 |
- |
|
12 |
-There's no database to set up, and you get to use tools like Emacs, Vim, or TextMate to write your posts, not some lame in-browser text editor. Just write, generate, deploy, using the same tools and patterns you already use for your daily work. |
|
13 |
- |
|
14 |
-[Read the wiki to learn more](http://wiki.github.com/imathis/octopress/) |
5 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,50 +0,0 @@ |
1 |
-title: "Test of Typography" |
|
2 |
-date: 2011-04-07 19:17 |
|
3 |
-layout: post |
|
4 |
- |
|
5 |
-In the past I've always designed my own business cards, printed them on expensive card stock, and hand-cut them with an X-Acto knife. My cards were way nicer than those my clients had gotten *professionally* printed with bubbly ink, no-bleed designs, and cheap paper. Though I put tremendous care into my cards, I never was happy with the design. |
|
6 |
- |
|
7 |
-## Why Have Business Cards? |
|
8 |
-I'm rarely asked for my business card except when I attend conferences, of which I attend one or two each year. As a freelance contractor, I leave work by walking twenty-five feet from my office to the couch. Many of the |
|
9 |
-people I work for I've never met in-person. |
|
10 |
- |
|
11 |
-When someone gives me their business card, I read it, pocket it, and eventually throw it out — sometimes before I remember to copy the information to my address book (sorry, just being honest). The reality is, with the ubiquity of the internet and with frictionless social networks like Twitter, I can connect with people immediately. So why have business cards? |
|
12 |
- |
|
13 |
-<!-- more --> |
|
14 |
- |
|
15 |
-### Inspiration Demands Action |
|
16 |
-In one of our campfire chats [Nathaniel Talbott](http://twitter.com/NTalbott) showed off his business cards which he printed through [Moo](http://moo.com). They were half the size of regular business cards featuring the company logo on the front, and the url on the back. The unique size of the card intrigued me, and days later I couldn't stop thinking about designing a set of mini-cards for myself. |
|
17 |
- |
|
18 |
-<img src="/content/blog/2010/cards/box.jpg" alt="cards in a box" width="300px" class="right"/> Moo's [MiniCard's](http://moo.com/products/minicards.php) are very unique. You can print 100 cards, each with a totally different back. With a typical printing service this would be prohibitively expensive, but with Moo the rules are different. This freedom encourages us to go beyond nicely styled contact information and branding. Some clever uses involve offering unique invite codes for a web application, or sharing a photography portfolio with Moo's Flickr import feature. |
|
19 |
- |
|
20 |
-I realized that I could print several design iterations and decide later which worked best. Without the pressure to choose a single design, I felt the freedom to create. |
|
21 |
- |
|
22 |
-### The Freedom to Fail |
|
23 |
-<img src="/content/blog/2010/cards/concepts.jpg" alt="card concepts" width="270px" class="left"/> I could be cheeky and print up half of my cards with my logo on one side and only my Twitter name on the other. For less than $20 for 100 cards, I wasn't even concerned about possibly screwing up a whole batch. So that's what I did. I designed cards that were good enough and I printed them. If the cards did't turn out how I wanted them to, I could improve and print again. |
|
24 |
- |
|
25 |
-<img src="/content/blog/2010/cards/handout.jpg" alt="handout cards" width="220px" class="right"/> The process was fun and simple, and as soon as I finished, I wanted to do it again. When my cards arrived, I was absolutely delighted by the print quality and the care put into their presentation. Smartly Moo even included some beautiful promotional cards to hand out when people inevitably ask about mine. |
|
26 |
- |
|
27 |
-### A Second Iteration |
|
28 |
-After holding the finished product, I began to see how my design could be improved. I learned that Gill Sans is harder to read at a small size in a high contrast print, so I switched to Futura. I showed my cards to some far-sighted friends and adjusted my font size accordingly. I discarded a background gradient (which I should have known wouldn't translate well to print) in favor of a solid color. **Sidenote:** On screen, gradients emulate the subtleties of a natural light source, but on a real object it doesn't make sense and generally looks bad. |
|
29 |
- |
|
30 |
-I changed my approach choosing a single design with multiple color variations. In the promotional cards Moo sent me, I learned that they do a fantastic job with bright colors and I wanted to use that boldness in my design. I was inspired by what [Seth Godin said](http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html): |
|
31 |
- |
|
32 |
-> Every interaction is both precious and an opportunity to delight. |
|
33 |
- |
|
34 |
-<img src="/content/blog/2010/cards/holder.jpg" alt="MiniCard Holder" width="220px" class="right"/> I pictured sliding a card out of my [MiniCard Holder](http://moo.com/products/accessories/holders/moo_minicard_holders) and revealing another brightly-colored card beneath. As I hand someone a card they'll see the flash of color and realize that their card was special, and different from my other cards. That's what I want my clients and future clients to feel. |
|
35 |
- |
|
36 |
-### The Final Design |
|
37 |
- |
|
38 |
-<img src="/content/blog/2010/cards/all.jpg" alt="all card designs" width="640px"/> |
|
39 |
- |
|
40 |
-The MiniCard's unique constraints inspired me with a fresh challenge and their pricing model encouraged me to experiment. Instead of treating business cards like a necessary design task, I saw them as a opportunity to release quickly, fail cheaply, and improve. Now when I give someone a business card, it's something valuable to me, and I hope they're delighted. |
|
41 |
- |
|
42 |
-**Update:** I thought I'd share some other great uses of Moo's MiniCards. There's a fantastic [Flikr pool](http://www.flickr.com/groups/moo/pool/), but here are some of my favorites. Enjoy: |
|
43 |
- |
|
44 |
-- [Product](http://www.flickr.com/photos/lushlampwork/4131018201/in/pool-moo) [tags](http://www.flickr.com/photos/lushlampwork/4297224179/in/pool-moo) |
|
45 |
-- [Photography](http://www.flickr.com/photos/thisiswoly/4206576342/in/pool-moo) or [art](http://www.flickr.com/photos/lesleybarnes/4276368956/in/pool-moo) [portfolios](http://www.flickr.com/photos/playinprogress/4158223112/in/pool-moo) |
|
46 |
-- [Gift](http://www.flickr.com/photos/polkadotcreations/4167249758/in/pool-moo) [tags](http://www.flickr.com/photos/22338102@N04/4278114745/in/pool-moo) |
|
47 |
-- [An advent calendar](http://www.flickr.com/photos/bcome/4177034036/in/pool-moo) |
|
48 |
- |
49 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,397 +0,0 @@ |
1 |
-layout: default |
|
2 |
-layout: page |
|
3 |
-nometa: true |
|
4 |
-title: Syntax Highlighting Debug |
|
5 |
- |
|
6 |
-<h3 class="filename">gist_syntax_test.rb</h3> |
|
7 |
-{% gist 996818 test.rb %} |
|
8 |
- |
|
9 |
-<h3 class="filename">syntax_test.diff</h3> |
|
10 |
-{% highlight diff %} |
|
11 |
-@@ -590,7 +590,7 @@ class SpritesTest < Test::Unit::TestCase |
|
12 |
- it "should generate a sprite from nested folders" do |
|
13 |
- css = render <<-SCSS |
|
14 |
-- @import "nested/*.png"; |
|
15 |
-+ @import "nested/**/*.png"; |
|
16 |
- @include all-nested-sprites; |
|
17 |
- SCSS |
|
18 |
- assert_correct css, <<-CSS |
|
19 |
- |
|
20 |
-{% endhighlight %} |
|
21 |
- |
|
22 |
-<h3 class="filename">syntax_test.html</h3> |
|
23 |
-{% highlight html %} |
|
24 |
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
25 |
-<html><head> |
|
26 |
-<title>A Tiny Page</title> |
|
27 |
-<style type="text/css"> |
|
28 |
-<!-- |
|
29 |
- p { font-size:15pt; color:#000 } |
|
30 |
- --> |
|
31 |
-</style></head><!-- real comment --> |
|
32 |
-<body bgcolor="#FFFFFF" text="#000000" link="#0000CC"> |
|
33 |
-<script language="javascript" type="text/javascript"> |
|
34 |
- function changeHeight(h) { |
|
35 |
- var tds = document.getElementsByTagName("td"); |
|
36 |
- for(var i = 0; i < tds.length; i++) { |
|
37 |
- tds[i].setAttribute("height", h + "px"); |
|
38 |
- }} |
|
39 |
-</script> |
|
40 |
-<h1>abc</h1> |
|
41 |
-<h2>def</h2> |
|
42 |
-<p>Testing page</p> |
|
43 |
-</body></html> |
|
44 |
-{% endhighlight %} |
|
45 |
- |
|
46 |
-<h3 class="filename">syntax_test.js</h3> |
|
47 |
-{% highlight js %} |
|
48 |
- |
|
49 |
-/** |
|
50 |
-sample javascript from xui |
|
51 |
-*/ |
|
52 |
- |
|
53 |
-var undefined, |
|
54 |
- xui, |
|
55 |
- window = this, |
|
56 |
- string = new String('string'), |
|
57 |
- document = window.document, |
|
58 |
- simpleExpr = /^#?([\w-]+)$/, |
|
59 |
- idExpr = /^#/, |
|
60 |
- tagExpr = /<([\w:]+)/, |
|
61 |
- slice = function (e) { return [].slice.call(e, 0); }; |
|
62 |
- try { var a = slice(document.documentElement.childNodes)[0].nodeType; } |
|
63 |
- catch(e){ slice = function (e) { var ret=[]; for (var i=0; e[i]; i++) |
|
64 |
- ret.push(e[i]); return ret; }; } |
|
65 |
- |
|
66 |
-window.x$ = window.xui = xui = function(q, context) { |
|
67 |
- return new xui.fn.find(q, context); |
|
68 |
-}; |
|
69 |
- |
|
70 |
- |
|
71 |
-{% endhighlight %} |
|
72 |
- |
|
73 |
-<h3 class="filename">syntax_test.rb</h3> |
|
74 |
-{% highlight ruby %} |
|
75 |
- |
|
76 |
-include Enumerable |
|
77 |
- |
|
78 |
-def initialize(rbconfig) |
|
79 |
-@rbconfig = rbconfig |
|
80 |
-@no_harm = false |
|
81 |
-end |
|
82 |
- |
|
83 |
-def load_savefile |
|
84 |
-begin |
|
85 |
- File.foreach(savefile()) do |line| |
|
86 |
- k, v = *line.split(/=/, 2) |
|
87 |
- self[k] = v.strip |
|
88 |
- end |
|
89 |
-rescue Errno::ENOENT |
|
90 |
- setup_rb_error $!.message + "\n#{File.basename($0)} config first" |
|
91 |
-end |
|
92 |
-end |
|
93 |
- |
|
94 |
-if c['rubylibdir'] |
|
95 |
- # V > 1.6.3 |
|
96 |
- libruby = "#{c['prefix']}/lib/ruby" |
|
97 |
- siterubyverarch = c['sitearchdir'] |
|
98 |
-end |
|
99 |
-parameterize = lambda {|path| |
|
100 |
- path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix') |
|
101 |
-} |
|
102 |
- |
|
103 |
-if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg } |
|
104 |
- makeprog = arg.sub(/'/, '').split(/=/, 2)[1] |
|
105 |
-else |
|
106 |
- makeprog = 'make' |
|
107 |
-end |
|
108 |
- |
|
109 |
-def setup_rb_error(msg) |
|
110 |
- raise SetupError, msg |
|
111 |
-end |
|
112 |
- |
|
113 |
-if $0 == __FILE__ |
|
114 |
- begin |
|
115 |
- ToplevelInstaller.invoke |
|
116 |
- rescue SetupError |
|
117 |
- raise if $DEBUG |
|
118 |
- $stderr.puts $!.message |
|
119 |
- $stderr.puts "Try 'ruby #{$0} --help' for detailed usage." |
|
120 |
- exit 1 |
|
121 |
- end |
|
122 |
-end |
|
123 |
-{% endhighlight %} |
|
124 |
- |
|
125 |
-<h3 class="filename">syntax_test.php</h3> |
|
126 |
-{% highlight php %} |
|
127 |
-<?php |
|
128 |
-require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/country/common.php"); |
|
129 |
-require_once($GLOBALS['g_campsiteDir']. "/classes/SimplePager.php"); |
|
130 |
-camp_load_translation_strings("api"); |
|
131 |
- |
|
132 |
-$f_country_language_selected = camp_session_get('f_language_selected', ''); |
|
133 |
-$f_country_offset = camp_session_get('f_country_offset', 0); |
|
134 |
-if (empty($f_country_language_selected)) { |
|
135 |
- $f_country_language_selected = null; |
|
136 |
-} |
|
137 |
-$ItemsPerPage = 20; |
|
138 |
-$languages = Language::GetLanguages(null, null, null, array(), array(), true); |
|
139 |
-$numCountries = Country::GetNumCountries($f_country_language_selected); |
|
140 |
- |
|
141 |
-$pager = new SimplePager($numCountries, $ItemsPerPage, "index.php?"); |
|
142 |
- |
|
143 |
-$crumbs = array(); |
|
144 |
-$crumbs[] = array(getGS("Configure"), ""); |
|
145 |
-$crumbs[] = array(getGS("Countries"), ""); |
|
146 |
-echo camp_html_breadcrumbs($crumbs); |
|
147 |
- |
|
148 |
-?> |
|
149 |
- |
|
150 |
-<?php if ($g_user->hasPermission("ManageCountries")) { ?> |
|
151 |
-<table BORDER="0" CELLSPACING="0" CELLPADDING="1"> |
|
152 |
- <tr> |
|
153 |
- <td><a href="add.php"><?php putGS("Add new"); ?></a></td> |
|
154 |
- </tr> |
|
155 |
-</table> |
|
156 |
-{% endhighlight %} |
|
157 |
- |
|
158 |
- |
|
159 |
-<h3 class="filename">syntax_test.hs</h3> |
|
160 |
-{% highlight hs %} |
|
161 |
-{-# LANGUAGE OverloadedStrings #-} |
|
162 |
-module Main where |
|
163 |
- |
|
164 |
-import Control.Arrow ((>>>), (***), arr) |
|
165 |
-import Control.Monad (forM_) |
|
166 |
- |
|
167 |
- |
|
168 |
-import Hakyll |
|
169 |
- |
|
170 |
- |
|
171 |
-main :: IO () |
|
172 |
-main = hakyll $ do |
|
173 |
- |
|
174 |
- route "css/*" $ setExtension "css" |
|
175 |
- compile "css/*" $ byExtension (error "Not a (S)CSS file") |
|
176 |
- [ (".css", compressCssCompiler) |
|
177 |
- , (".scss", sass) |
|
178 |
- ] |
|
179 |
- |
|
180 |
- route "js/**" idRoute |
|
181 |
- compile "js/**" copyFileCompiler |
|
182 |
- |
|
183 |
- route "img/*" idRoute |
|
184 |
- compile "img/*" copyFileCompiler |
|
185 |
- |
|
186 |
- compile "templates/*" templateCompiler |
|
187 |
- |
|
188 |
- forM_ ["test.md", "index.md"] $ \page -> do |
|
189 |
- route page $ setExtension "html" |
|
190 |
- compile page $ pageCompiler |
|
191 |
- >>> applyTemplateCompiler "templates/default.html" |
|
192 |
- >>> relativizeUrlsCompiler |
|
193 |
- |
|
194 |
-sass :: Compiler Resource String |
|
195 |
-sass = getResourceString >>> unixFilter "sass" ["-s", "--scss"] |
|
196 |
- >>> arr compressCss |
|
197 |
- |
|
198 |
-{% endhighlight %} |
|
199 |
- |
|
200 |
-<h3 class="filename">syntax_test.sh</h3> |
|
201 |
-{% highlight sh %} |
|
202 |
-#!/bin/bash |
|
203 |
- |
|
204 |
-cd $ROOT_DIR |
|
205 |
-DOT_FILES="lastpass weechat ssh Xauthority" |
|
206 |
-for dotfile in $DOT_FILES; do conform_link "$DATA_DIR/$dotfile" ".$dotfile"; done |
|
207 |
- |
|
208 |
-# TODO: refactor with suffix variables (or common cron values) |
|
209 |
- |
|
210 |
-case "$PLATFORM" in |
|
211 |
- linux) |
|
212 |
- #conform_link "$CONF_DIR/shell/zshenv" ".zshenv" |
|
213 |
- crontab -l > $ROOT_DIR/tmp/crontab-conflict-arch |
|
214 |
- cd $ROOT_DIR/$CONF_DIR/cron |
|
215 |
- if [[ "$(diff ~/tmp/crontab-conflict-arch crontab-current-arch)" == "" |
|
216 |
- ]]; |
|
217 |
- then # no difference with current backup |
|
218 |
- logger "$LOG_PREFIX: crontab live settings match stored "\ |
|
219 |
- "settings; no restore required" |
|
220 |
- rm ~/tmp/crontab-conflict-arch |
|
221 |
- else # current crontab settings in file do not match live settings |
|
222 |
- crontab $ROOT_DIR/$CONF_DIR/cron/crontab-current-arch |
|
223 |
- logger "$LOG_PREFIX: crontab stored settings conflict with "\ |
|
224 |
- "live settings; stored settings restored. "\ |
|
225 |
- "Previous settings recorded in ~/tmp/crontab-conflict-arch." |
|
226 |
- fi |
|
227 |
- ;; |
|
228 |
- |
|
229 |
-{% endhighlight %} |
|
230 |
- |
|
231 |
-<h3 class="filename">syntax_test.py</h3> |
|
232 |
-{% highlight py %} |
|
233 |
-# test python (sample from offlineimap) |
|
234 |
- |
|
235 |
-class ExitNotifyThread(Thread): |
|
236 |
- """This class is designed to alert a "monitor" to the fact that a thread has |
|
237 |
- exited and to provide for the ability for it to find out why.""" |
|
238 |
- def run(self): |
|
239 |
- global exitthreads, profiledir |
|
240 |
- self.threadid = thread.get_ident() |
|
241 |
- try: |
|
242 |
- if not profiledir: # normal case |
|
243 |
- Thread.run(self) |
|
244 |
- else: |
|
245 |
- try: |
|
246 |
- import cProfile as profile |
|
247 |
- except ImportError: |
|
248 |
- import profile |
|
249 |
- prof = profile.Profile() |
|
250 |
- try: |
|
251 |
- prof = prof.runctx("Thread.run(self)", globals(), locals()) |
|
252 |
- except SystemExit: |
|
253 |
- pass |
|
254 |
- prof.dump_stats( \ |
|
255 |
- profiledir + "/" + str(self.threadid) + "_" + \ |
|
256 |
- self.getName() + ".prof") |
|
257 |
- except: |
|
258 |
- self.setExitCause('EXCEPTION') |
|
259 |
- if sys: |
|
260 |
- self.setExitException(sys.exc_info()[1]) |
|
261 |
- tb = traceback.format_exc() |
|
262 |
- self.setExitStackTrace(tb) |
|
263 |
- else: |
|
264 |
- self.setExitCause('NORMAL') |
|
265 |
- if not hasattr(self, 'exitmessage'): |
|
266 |
- self.setExitMessage(None) |
|
267 |
- |
|
268 |
- if exitthreads: |
|
269 |
- exitthreads.put(self, True) |
|
270 |
- |
|
271 |
- def setExitCause(self, cause): |
|
272 |
- self.exitcause = cause |
|
273 |
- def getExitCause(self): |
|
274 |
- """Returns the cause of the exit, one of: |
|
275 |
- 'EXCEPTION' -- the thread aborted because of an exception |
|
276 |
- 'NORMAL' -- normal termination.""" |
|
277 |
- return self.exitcause |
|
278 |
- def setExitException(self, exc): |
|
279 |
- self.exitexception = exc |
|
280 |
- def getExitException(self): |
|
281 |
- """If getExitCause() is 'EXCEPTION', holds the value from |
|
282 |
- sys.exc_info()[1] for this exception.""" |
|
283 |
- return self.exitexception |
|
284 |
- def setExitStackTrace(self, st): |
|
285 |
- self.exitstacktrace = st |
|
286 |
- def getExitStackTrace(self): |
|
287 |
- """If getExitCause() is 'EXCEPTION', returns a string representing |
|
288 |
- the stack trace for this exception.""" |
|
289 |
- return self.exitstacktrace |
|
290 |
- def setExitMessage(self, msg): |
|
291 |
- """Sets the exit message to be fetched by a subsequent call to |
|
292 |
- getExitMessage. This message may be any object or type except |
|
293 |
- None.""" |
|
294 |
- self.exitmessage = msg |
|
295 |
- def getExitMessage(self): |
|
296 |
- """For any exit cause, returns the message previously set by |
|
297 |
- a call to setExitMessage(), or None if there was no such message |
|
298 |
- set.""" |
|
299 |
- return self.exitmessage |
|
300 |
- |
|
301 |
-{% endhighlight %} |
|
302 |
- |
|
303 |
-<h3 class="filename">syntax_test.pl</h3> |
|
304 |
-{% highlight perl %} |
|
305 |
-#!perl -w |
|
306 |
- |
|
307 |
-# Time-stamp: <2002/04/06, 13:12:13 (EST), maverick, csvformat.pl> |
|
308 |
-# Two pass CSV file to table formatter |
|
309 |
- |
|
310 |
-$delim = $#ARGV >= 1 ? $ARGV[1] : ','; |
|
311 |
-print STDERR "Split pattern: $delim\n"; |
|
312 |
- |
|
313 |
-# first pass |
|
314 |
-open F, "<$ARGV[0]" or die; |
|
315 |
-while(<F>) |
|
316 |
-{ |
|
317 |
- chomp; |
|
318 |
- $i = 0; |
|
319 |
- map { $max[$_->[1]] = $_->[0] if $_->[0] > ($max[$_->[1]] || 0) } |
|
320 |
- (map {[length $_, $i++]} split($delim)); |
|
321 |
-} |
|
322 |
-close F; |
|
323 |
- |
|
324 |
-print STDERR 'Field width: ', join(', ', @max), "\n"; |
|
325 |
-print STDERR join(' ', map {'-' x $_} @max); |
|
326 |
- |
|
327 |
-# second pass |
|
328 |
-open F, "<$ARGV[0]" or die; |
|
329 |
-while(<F>) |
|
330 |
- { |
|
331 |
- chomp; |
|
332 |
- $i = 0; |
|
333 |
- map { printf("%-$max[$_->[1]]s ", $_->[0]) } |
|
334 |
- (map {[$_, $i++]} split($delim)); |
|
335 |
- print "\n"; |
|
336 |
-} |
|
337 |
-close F; |
|
338 |
- |
|
339 |
-{% endhighlight %} |
|
340 |
- |
|
341 |
-<h3 class="filename">syntax_test.java</h3> |
|
342 |
-{% highlight java %} |
|
343 |
-import java.util.Map; |
|
344 |
-import java.util.TreeSet; |
|
345 |
- |
|
346 |
-public class GetEnv { |
|
347 |
- /** |
|
348 |
- * let's test generics |
|
349 |
- * @param args the command line arguments |
|
350 |
- */ |
|
351 |
- public static void main(String[] args) { |
|
352 |
- // get a map of environment variables |
|
353 |
- Map<String, String> env = System.getenv(); |
|
354 |
- // build a sorted set out of the keys and iterate |
|
355 |
- for(String k: new TreeSet<String>(env.keySet())) { |
|
356 |
- System.out.printf("%s = %s\n", k, env.get(k)); |
|
357 |
- } |
|
358 |
- } } |
|
359 |
-{% endhighlight %} |
|
360 |
- |
|
361 |
-<h3 class="filename">syntax_test.c</h3> |
|
362 |
-{% highlight c %} |
|
363 |
-#define UNICODE |
|
364 |
-#include <windows.h> |
|
365 |
- |
|
366 |
-int main(int argc, char **argv) { |
|
367 |
- int speed = 0, speed1 = 0, speed2 = 0; // 1-20 |
|
368 |
- printf("Set Mouse Speed by Maverick\n"); |
|
369 |
- |
|
370 |
- SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); |
|
371 |
- printf("Current speed: %2d\n", speed); |
|
372 |
- |
|
373 |
- if (argc == 1) return 0; |
|
374 |
- if (argc >= 2) sscanf(argv[1], "%d", &speed1); |
|
375 |
- if (argc >= 3) sscanf(argv[2], "%d", &speed2); |
|
376 |
- |
|
377 |
- if (argc == 2) // set speed to first value |
|
378 |
- speed = speed1; |
|
379 |
- else if (speed == speed1 || speed == speed2) // alternate |
|
380 |
- speed = speed1 + speed2 - speed; |
|
381 |
- else |
|
382 |
- speed = speed1; // start with first value |
|
383 |
- |
|
384 |
- SystemParametersInfo(SPI_SETMOUSESPEED, 0, speed, 0); |
|
385 |
- SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); |
|
386 |
- printf("New speed: %2d\n", speed); |
|
387 |
- return 0; |
|
388 |
-} |
|
389 |
- |
|
390 |
-{% endhighlight %} |
|
391 |
- |
392 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,114 +0,0 @@ |
1 |
-layout: page |
|
2 |
-title: Typography Testing |
|
3 |
-sidebar: none |
|
4 |
- |
|
5 |
-%h1 Level 01 Heading |
|
6 |
-%h2 Level 02 Heading |
|
7 |
-%h3 Level 03 Heading |
|
8 |
-%h4 Level 04 Heading |
|
9 |
-%h5 Level 05 Heading |
|
10 |
-%h6 Level 06 Heading |
|
11 |
- |
|
12 |
- |
|
13 |
-%p |
|
14 |
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce sodales ligula sed urna. Aliquam posuere arcu |
|
15 |
- viverra erat. Pellentesque et enim dapibus ante facilisis bibendum. Nam congue dapibus urna. Vestibulum consequat |
|
16 |
- arcu at magna. Nunc faucibus mollis lacus. Nulla tempor luctus tellus. Donec blandit lobortis pede. Vestibulum |
|
17 |
- vel pede ut urna eleifend lacinia. |
|
18 |
- |
|
19 |
-%h2 Level 02 Heading |
|
20 |
- |
|
21 |
-%p |
|
22 |
- Maecenas ligula nibh, imperdiet at, interdum eget, sagittis eu, enim. Vivamus vel urna. Donec fringilla |
|
23 |
- ullamcorper sem. In risus arcu, pellentesque cursus, faucibus cursus, consequat quis, est. Aliquam id erat. |
|
24 |
- Aliquam arcu. Phasellus vulputate. Integer sem diam, mattis vel, viverra ullamcorper, ultricies quis, nisl. Sed |
|
25 |
- sollicitudin quam ut nisi. Vivamus velit sapien, volutpat eu, faucibus id, nonummy id, urna. |
|
26 |
- |
|
27 |
-%h3 Level 03 Heading |
|
28 |
- |
|
29 |
-%p |
|
30 |
- Take it<sub>2</sub> to the power of<sup>3</sup> |
|
31 |
- Praesent iaculis pellentesque est. Nulla facilisi. Etiam fringilla vehicula orci. Aliquam fermentum ipsum id |
|
32 |
- nulla. Aliquam interdum laoreet leo. Cras accumsan. Nam pharetra diam id nunc. Integer blandit tellus vulputate |
|
33 |
- felis. Cras aliquam, eros in euismod aliquam, enim nisl mollis metus, quis fringilla ipsum diam ut pede. Mauris a |
|
34 |
- libero ac velit interdum pulvinar. Nunc ipsum mauris, semper rhoncus, feugiat ut, egestas id, diam. Nullam |
|
35 |
- porttitor condimentum risus. Vivamus nec enim eget nisi commodo euismod. Ut turpis. Nullam malesuada rutrum |
|
36 |
- neque. Nam sodales porta elit. Mauris mollis nisl vel augue. |
|
37 |
- |
|
38 |
-%p |
|
39 |
- And we were like <q>Woah</q>, and he was like <q>Woah</q>, and they were like <q>WOAH!</q> <code><\reference></code> |
|
40 |
- |
|
41 |
-%p |
|
42 |
- %abbr(title="For The Win!") FTW! |
|
43 |
-%p |
|
44 |
- |
|
45 |
-%h3 Unordered lists |
|
46 |
-%ul |
|
47 |
- %li Lorem ipsum dolor sit amet |
|
48 |
- %li Consectetur adipisicing elit |
|
49 |
- %li Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua |
|
50 |
- %li Ut enim ad minim veniam |
|
51 |
- |
|
52 |
-%h3 Ordered lists |
|
53 |
-%ol |
|
54 |
- %li Consectetur adipisicing elit |
|
55 |
- %li Sed do eiusmod tempor incididunt ut labore |
|
56 |
- %li Et dolore magna aliqua |
|
57 |
- |
|
58 |
-%h3 Blockquotes |
|
59 |
-%blockquote |
|
60 |
- %p |
|
61 |
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore |
|
62 |
- magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo |
|
63 |
- consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
|
64 |
- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
|
65 |
- |
|
66 |
-%h3 Tables |
|
67 |
-%table |
|
68 |
- %caption |
|
69 |
- Jimi Hendrix - albums |
|
70 |
- %thead |
|
71 |
- %tr |
|
72 |
- %th Album |
|
73 |
- %th Year |
|
74 |
- %th Price |
|
75 |
- %tfoot |
|
76 |
- %tr |
|
77 |
- %td Album |
|
78 |
- %td Year |
|
79 |
- %td Price |
|
80 |
- %tbody |
|
81 |
- %tr |
|
82 |
- %td Are You Experienced |
|
83 |
- %td 1967 |
|
84 |
- %td $10.00 |
|
85 |
- %tr |
|
86 |
- %td Axis: Bold as Love |
|
87 |
- %td 1967 |
|
88 |
- %td $12.00 |
|
89 |
- %tr |
|
90 |
- %td Electric Ladyland |
|
91 |
- %td 1968 |
|
92 |
- %td $10.00 |
|
93 |
- %tr |
|
94 |
- %td Band of Gypsys |
|
95 |
- %td 1970 |
|
96 |
- %td $12.00 |
|
97 |
-%p |
|
98 |
- %a(href="#")Link |
|
99 |
- %br/ |
|
100 |
- %strong <strong> |
|
101 |
- %br/ |
|
102 |
- %del <del> deleted |
|
103 |
- %br/ |
|
104 |
- %dfn <dfn> dfn |
|
105 |
- %br/ |
|
106 |
- %em <em> emphasis |
|
107 |
- %br/ |
|
108 |
- |
|
109 |
-%tt |
|
110 |
- <tt> |
|
111 |
- Pellentesque tempor, dui ut ultrices viverra, neque urna blandit nisi, id accumsan dolor est vitae risus. |
|
112 |
-%hr |