Skip to content

Commit

Permalink
Blurped again ... grizzly
Browse files Browse the repository at this point in the history
  • Loading branch information
gus committed Feb 28, 2010
1 parent e07f439 commit bd6837e
Show file tree
Hide file tree
Showing 56 changed files with 501 additions and 456 deletions.
14 changes: 3 additions & 11 deletions _site/blurp/index.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>Blurp!</h1>
<div class="summary"><em>Random thoughts, phrases, words, whatever that just pop into my head</em></div>
</div>
Expand Down Expand Up @@ -96,6 +97,7 @@ <h3>Check me out!</h3>
<em>Reverse chronological order</em>

<ul>
<li>Grizly Gus guzzles gallons of coffee</li>
<li>It feels like a newspaper without the newspaper feel</li>
<li>I suppose you could see the future. If you envisioned what you wanted, only concerned yourself with that, and didn't give a shit about anything else.</li>
<li>I'm all blogged up!</li>
Expand Down Expand Up @@ -123,16 +125,6 @@ <h3>Check me out!</h3>
<ul>
<h3>Into the Past</h3>
<li>

<li>
<a href="/life/extended-tetris.html">Extended Tetris</a>
<p><em>Taking pieces beyond x and y shifts</em></p>
</li>

<li>
<a href="/code/cant-spell-waterfall.html">Random Thoughts, ed. 3 - Can't Spell Waterfall</a>
<p><em>At least not without these other spellings</em></p>
</li>

</li>

Expand Down
3 changes: 2 additions & 1 deletion _site/code/affirmation-of-a-programmer.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>Affirmation of a programmer</h1>
<div class="summary"><em>Thoughts on a friend who played programmer with me for a day</em></div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions _site/code/beautiful-code-readability-performance.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>Readability and Performance is Beautiful Code</h1>
<div class="summary"><em>Thoughts on what makes code beautiful</em></div>
</div>
Expand Down Expand Up @@ -91,7 +92,7 @@ <h3>Check me out!</h3>
<p>Seems as though there are some strong opinions from some that readability of code is secondary to the performance of code. I figured I would some up my thoughts and did so in the following matrix:</p>
<img src='/images/articles/code/code-perf-read.png' />
<p>To be clear, this is the code in question:</p>
<div class='highlight'><pre><code class='ruby'><span class='k'>if</span> <span class='n'>foaf</span><span class='o'>.</span><span class='n'>has_key?</span> <span class='s1'>&#39;&lt;&gt;&#39;</span>
<div class='highlight'><pre><span class='k'>if</span> <span class='n'>foaf</span><span class='o'>.</span><span class='n'>has_key?</span> <span class='s1'>&#39;&lt;&gt;&#39;</span>
<span class='n'>knows</span> <span class='o'>=</span> <span class='n'>foaf</span><span class='o'>[</span><span class='s1'>&#39;&lt;&gt;&#39;</span><span class='o'>][</span><span class='s2'>&quot;&lt;http://xmlns.com/foaf/0.1/knows&gt;&quot;</span><span class='o'>]</span>
<span class='k'>if</span> <span class='o'>!</span><span class='n'>knows</span><span class='o'>.</span><span class='n'>nil?</span>
<span class='n'>knows</span><span class='o'>.</span><span class='n'>each</span> <span class='k'>do</span> <span class='o'>|</span><span class='n'>know</span><span class='o'>|</span>
Expand All @@ -110,7 +111,7 @@ <h3>Check me out!</h3>
<span class='k'>end</span>
<span class='k'>end</span>
<span class='k'>end</span>
</code></pre>
</pre>
</div>
<p>Keep an eye on <a href='http://slickorslack.com'>Slick or Slack</a> for this little piece of code I threw up <a href='http://slickorslack.com/codes/100'>there</a>. If my assumption is right, it will be one of the slackest of all.</p>

Expand Down
3 changes: 2 additions & 1 deletion _site/code/cant-spell-waterfall.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>Random Thoughts, ed. 3 - Can't Spell Waterfall</h1>
<div class="summary"><em>At least not without these other spellings</em></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion _site/code/daily-js.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>DailyJS.com</h1>
<div class="summary"><em>A new (as of this writing) daily news blog for JavaScript stuff</em></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion _site/code/erlang/erlang-diaries-vol1.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>Erlang Diaries - Vol 1</h1>
<div class="summary"><em>Brought to you by the lower-case letter 'c'</em></div>
</div>
Expand Down
1 change: 1 addition & 0 deletions _site/code/erlang/index.html
Expand Up @@ -53,6 +53,7 @@
<div id="main" class='grid_12 alpha omega'>



<div id="articles" class="grid_8 alpha">
<div id="article">
<div class="header cleafix">
Expand Down
3 changes: 2 additions & 1 deletion _site/code/history-blog-meme.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>History Blog Meme</h1>
<div class="summary"><em>Just like it says; a meme focused on your most typed commands</em></div>
</div>
Expand Down
1 change: 1 addition & 0 deletions _site/code/index.html
Expand Up @@ -53,6 +53,7 @@
<div id="main" class='grid_12 alpha omega'>



<div id="articles" class="grid_8 alpha">
<div id="article">
<div class="header cleafix">
Expand Down
15 changes: 8 additions & 7 deletions _site/code/password-sophistication.html
Expand Up @@ -51,7 +51,8 @@
</div>

<div id="main" class='grid_12 alpha omega'>
<div id="page_title">

<div id="page_title">
<h1>Password Sophistication</h1>
<div class="summary"><em>My implementation of a web-based password strength meter</em></div>
</div>
Expand Down Expand Up @@ -177,7 +178,7 @@ <h2 id='implementation'>Implementation</h2>
<p>My initial implementation was essentially the implementation from Code &amp; Coffee with the algorithm of Geek Wisdom; but what I really wanted was a nice OO thing. I also wanted to be able to define colors in CSS.</p>

<p>My final JavaScript looks like the following (passwd.js):</p>
<div class='highlight'><pre><code class='javascript'><span class='nx'>PasswordSophistication</span> <span class='o'>=</span> <span class='nx'>Class</span><span class='p'>.</span><span class='nx'>create</span><span class='p'>();</span>
<div class='highlight'><pre><span class='nx'>PasswordSophistication</span> <span class='o'>=</span> <span class='nx'>Class</span><span class='p'>.</span><span class='nx'>create</span><span class='p'>();</span>
<span class='nb'>Object</span><span class='p'>.</span><span class='nx'>extend</span><span class='p'>(</span><span class='nx'>PasswordSophistication</span><span class='p'>.</span><span class='nx'>prototype</span><span class='o'>,</span> <span class='p'>{</span>
<span class='nx'>initialize</span><span class='o'>:</span> <span class='k'>function</span><span class='p'>(</span><span class='nx'>passwordFieldId</span><span class='o'>,</span> <span class='nx'>fieldIdPrefix</span><span class='p'>)</span> <span class='p'>{</span>
<span class='k'>this</span><span class='p'>.</span><span class='nx'>passwordField</span> <span class='o'>=</span> <span class='nb'>document</span><span class='p'>.</span><span class='nx'>getElementById</span><span class='p'>(</span><span class='nx'>passwordFieldId</span><span class='p'>);</span>
Expand Down Expand Up @@ -244,10 +245,10 @@ <h2 id='implementation'>Implementation</h2>
<span class='k'>this</span><span class='p'>.</span><span class='nx'>textElement</span><span class='p'>.</span><span class='nx'>innerHTML</span> <span class='o'>=</span> <span class='nx'>rate</span><span class='p'>[</span><span class='mi'>1</span><span class='p'>];</span>
<span class='p'>}</span>
<span class='p'>});</span>
</code></pre>
</pre>
</div>
<p>Following is an excerpt of how to use it:</p>
<div class='highlight'><pre><code class='html'><span class='nt'>&lt;script </span><span class='na'>src=</span><span class='s'>&quot;/javascripts/passwd.js&quot;</span> <span class='na'>type=</span><span class='s'>&quot;text/javascript&quot;</span><span class='nt'>&gt;&lt;/script&gt;</span>
<div class='highlight'><pre><span class='nt'>&lt;script </span><span class='na'>src=</span><span class='s'>&quot;/javascripts/passwd.js&quot;</span> <span class='na'>type=</span><span class='s'>&quot;text/javascript&quot;</span><span class='nt'>&gt;&lt;/script&gt;</span>
<span class='nt'>&lt;link</span> <span class='na'>href=</span><span class='s'>&quot;/stylesheets/passwd.css&quot;</span> <span class='na'>media=</span><span class='s'>&quot;screen&quot;</span> <span class='na'>rel=</span><span class='s'>&quot;Stylesheet&quot;</span> <span class='na'>type=</span><span class='s'>&quot;text/css&quot;</span> <span class='nt'>/&gt;</span>
<span class='nt'>&lt;p&gt;</span>
<span class='nt'>&lt;div</span> <span class='na'>class=</span><span class='s'>&#39;label&#39;</span><span class='nt'>&gt;&lt;label</span> <span class='na'>for=</span><span class='s'>&#39;password&#39;</span><span class='nt'>&gt;</span>Password<span class='nt'>&lt;/label&gt;&lt;/div&gt;</span>
Expand All @@ -263,7 +264,7 @@ <h2 id='implementation'>Implementation</h2>
<span class='nt'>&lt;script&gt;</span>
<span class='nx'>passwdMeter</span> <span class='o'>=</span> <span class='k'>new</span> <span class='nx'>PasswordSophistication</span><span class='p'>(</span><span class='s1'>&#39;user_password&#39;</span><span class='o'>,</span> <span class='s1'>&#39;passwd&#39;</span><span class='p'>);</span>
<span class='nt'>&lt;/script&gt;</span>
</code></pre>
</pre>
</div>
<p>So, the important part is the initialization of the meter via the PasswordSophistication object. The PasswordSophistication constructor expects two DOM Id&#8217;s:</p>

Expand All @@ -278,14 +279,14 @@ <h2 id='implementation'>Implementation</h2>
<p>The other important piece is the <strong>onkeyup</strong> defined in the password field, which calls <em>update()</em> on the password meter object.</p>

<p>Now, colors come in via CSS (passwd.css):</p>
<div class='highlight'><pre><code class='css'><span class='nf'>#passwd_text</span> <span class='p'>{</span><span class='k'>font-size</span><span class='o'>:</span> <span class='m'>70%</span><span class='p'>;</span> <span class='k'>color</span><span class='o'>:</span> <span class='m'>#777</span><span class='p'>;}</span>
<div class='highlight'><pre><span class='nf'>#passwd_text</span> <span class='p'>{</span><span class='k'>font-size</span><span class='o'>:</span> <span class='m'>70%</span><span class='p'>;</span> <span class='k'>color</span><span class='o'>:</span> <span class='m'>#777</span><span class='p'>;}</span>
<span class='nf'>#passwd_meter</span> <span class='p'>{</span><span class='k'>height</span><span class='o'>:</span> <span class='m'>.5ex</span><span class='p'>;</span> <span class='k'>border</span><span class='o'>:</span> <span class='m'>1px</span> <span class='k'>solid</span> <span class='m'>#ddd</span><span class='p'>;}</span>
<span class='nf'>#passwd_bar</span> <span class='p'>{</span><span class='k'>height</span><span class='o'>:</span> <span class='m'>.5ex</span><span class='p'>;}</span>
<span class='nf'>#passwd_bar</span><span class='nc'>.sophisticated</span> <span class='p'>{</span><span class='k'>background-color</span><span class='o'>:</span> <span class='nb'>green</span><span class='p'>;}</span>
<span class='nf'>#passwd_bar</span><span class='nc'>.smart</span> <span class='p'>{</span><span class='k'>background-color</span><span class='o'>:</span> <span class='m'>#a0ff01</span><span class='p'>;}</span>
<span class='nf'>#passwd_bar</span><span class='nc'>.weak</span> <span class='p'>{</span><span class='k'>background-color</span><span class='o'>:</span> <span class='nb'>orange</span><span class='p'>;}</span>
<span class='nf'>#passwd_bar</span><span class='nc'>.risky</span> <span class='p'>{</span><span class='k'>background-color</span><span class='o'>:</span> <span class='nb'>red</span><span class='p'>;}</span>
</code></pre>
</pre>
</div>
<p>That&#8217;s pretty simple. Here&#8217;s what it looks like with my <strong>smart</strong> password:</p>
<img src='/images/articles/code/smart-passwd.png' />
Expand Down

0 comments on commit bd6837e

Please sign in to comment.