-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
350 lines (161 loc) · 11.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>in parens</title>
<meta name="author" content="Matthew Bennett">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/images/favicon.ico" />
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png"/>
<link href="/stylesheets/combined.min.css" rel="stylesheet" />
<script src="/scripts/modernizr-2.0.js"></script>
</head>
<body>
<div id="wrapper">
<header>
<h1>
(<a href="/">in parens</a>)
</h1>
<ul>
<li><a class="twitter" href="http://twitter.com/#!/Lobstrosity">@Lobstrosity</a></li>
</ul>
</header>
<div id="content">
<div class="blog-index">
<article>
<h2 class="entry-title"><a href="/2012/01/21/formatting-numbers-with-commas-in-javascript/">Formatting Numbers With Commas in JavaScript</a></h2>
<div class="meta">
<p class="date">
<time datetime="2012-01-21T14:31:00-07:00" pubdate>Jan 21<span>st</span>, 2012</time>
</p>
<p class="tags">
<a class='category' href='/archive/formatting/'>formatting</a>, <a class='category' href='/archive/javascript/'>javascript</a>
</p>
</div>
<div class="entry-content"><p>It seems every JavaScript blogger out there has his or her own post with a solution for formatting numbers to insert commas. So here are my obligatory two cents.</p>
<p class="gist"><a href="http://gist.github.com/1654123#file_commafy.1.js" data-file="commafy.1.js">Gist 1654123: commafy.1.js</a></p>
<p>I’ll try to set my post apart slightly by providing a detailed explanation.</p>
<p><a href="/2012/01/21/formatting-numbers-with-commas-in-javascript/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2011/08/17/gist-embeds-redux/">Gist Embeds Redux</a></h2>
<div class="meta">
<p class="date">
<time datetime="2011-08-17T20:54:00-07:00" pubdate>Aug 17<span>th</span>, 2011</time>
</p>
<p class="tags">
<a class='category' href='/archive/gist/'>gist</a>, <a class='category' href='/archive/github/'>github</a>, <a class='category' href='/archive/javascript/'>javascript</a>, <a class='category' href='/archive/jquery/'>jquery</a>
</p>
</div>
<div class="entry-content"><p>When this blog was still on Tumblr, I blogged about <a href="/2010/10/20/embedding-github-gists-in-tumblr-posts/" title="Embedding GitHub Gists in Tumblr Posts">embedding GitHub Gists in Tumblr posts</a>. Doing so has a few advantages:</p>
<ol>
<li>You don’t have to sprinkle <code>script</code> tags throughout your <code>body</code>. You just include links (<code>a</code>-style) to your Gists and then a single script—referenced at the bottom of the document—does all the magic.</li>
<li>You don’t have to include the default Gist stylesheet at all if you don’t want to. This is useful if your Gist styles are different and you don’t want to worry about using <code>!important</code> or making sure your selectors are more specific than theirs.</li>
<li>If the user has JavaScript disabled, they still see a link to the Gist.</li>
</ol>
<p>Back in those days, if I wanted a Gist in a post, I would make a new Gist for every piece of code I wanted to include. That got ugly, though, so I decided I would start making a single multi-file Gist per post, where each “file” was a separate piece of code to be used in the post. This required a few changes to the script.</p>
<p><a href="/2011/08/17/gist-embeds-redux/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2011/08/13/respond-js/">Respond.js</a></h2>
<div class="meta">
<p class="date">
<time datetime="2011-08-13T20:24:00-07:00" pubdate>Aug 13<span>th</span>, 2011</time>
</p>
<p class="tags">
<a class='category' href='/archive/css/'>css</a>, <a class='category' href='/archive/javascript/'>javascript</a>, <a class='category' href='/archive/polyfill/'>polyfill</a>
</p>
</div>
<div class="entry-content"><p>In <a href="/2010/12/09/css-media-queries/" title="CSS Media Queries">a previous post</a>, due to a lack of browser support for CSS media queries (in both mobile and desktop browsers), I came to the unfortunate conclusion that…</p>
<blockquote><p>Whether you baseline for desktop and use media queries to dynamically assign styles for mobile, or you baseline for mobile and use media queries to dynamically assign styles for desktop, you’re going to leave a non-trivial number of browsers out in the cold.</p></blockquote>
<h3>Respond</h3>
<p>And then came <a href="https://github.com/scottjehl/Respond" title="scottjehl/Respond at master (github.com)">Respond.js</a>.</p>
<p><a href="/2011/08/13/respond-js/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2011/08/08/mapping-parent-child-relationships-with-dapper/">Mapping Parent-Child Relationships With Dapper</a></h2>
<div class="meta">
<p class="date">
<time datetime="2011-08-08T17:39:00-07:00" pubdate>Aug 8<span>th</span>, 2011</time>
</p>
<p class="tags">
<a class='category' href='/archive/dapper/'>dapper</a>, <a class='category' href='/archive/dot-net/'>dot-net</a>
</p>
</div>
<div class="entry-content"><p>Dapper is a great, new (kind of), tiny database object mapper for the .NET framework. Its footprint is a single file. Drop it in your project and it adds a handful of extension methods to the <code>IDbConnection</code> interface.</p>
<p>Dapper’s focus is on speed. According to the <a href="http://code.google.com/p/dapper-dot-net/#Performance" title="dapper-dot-net Performance (code.google.com)">project’s home page</a>, it’s barely slower than hand-coding your own mapping with a <code>SqlDataReader</code>. What those few milliseconds buy you, though, is automatic mapping to your POCOs. Speed isn’t free, though. But I’ll get to that part later.</p>
<p><a href="/2011/08/08/mapping-parent-child-relationships-with-dapper/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2010/12/14/using-arrays-in-templates/">Using Arrays in Templates</a></h2>
<div class="meta">
<p class="date">
<time datetime="2010-12-14T19:56:00-07:00" pubdate>Dec 14<span>th</span>, 2010</time>
</p>
<p class="tags">
<a class='category' href='/archive/arrays/'>arrays</a>, <a class='category' href='/archive/jquery/'>jquery</a>, <a class='category' href='/archive/templates/'>templates</a>, <a class='category' href='/archive/tmpl/'>tmpl</a>
</p>
</div>
<div class="entry-content"><p>According to the official documentation, <a href="http://api.jquery.com/tmpl/" title=".tmpl() - jQuery API (api.jquery.com)"><code>.tmpl()</code></a>’s data parameter…</p>
<blockquote><p>…can be any JavaScript type, including Array or Object.</p></blockquote>
<p><a href="/2010/12/14/using-arrays-in-templates/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2010/12/13/jquery-templates-plugin/">jQuery Templates Plugin</a></h2>
<div class="meta">
<p class="date">
<time datetime="2010-12-13T19:25:00-07:00" pubdate>Dec 13<span>th</span>, 2010</time>
</p>
<p class="tags">
<a class='category' href='/archive/jquery/'>jquery</a>, <a class='category' href='/archive/templates/'>templates</a>, <a class='category' href='/archive/tmpl/'>tmpl</a>
</p>
</div>
<div class="entry-content"><h3>Requirements</h3>
<p>jQuery Templates is a plugin to jQuery (requiring at least version 1.4.2), so your page will need to reference both jQuery and the templates plugin (in that order).</p>
<p><a href="/2010/12/13/jquery-templates-plugin/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2010/12/09/css-media-queries/">CSS Media Queries</a></h2>
<div class="meta">
<p class="date">
<time datetime="2010-12-09T17:54:00-07:00" pubdate>Dec 9<span>th</span>, 2010</time>
</p>
<p class="tags">
<a class='category' href='/archive/css/'>css</a>, <a class='category' href='/archive/html/'>html</a>, <a class='category' href='/archive/media-queries/'>media-queries</a>
</p>
</div>
<div class="entry-content"><p>Open up <a href="http://www.colly.com" title="Simon Collison (www.colly.com)">www.colly.com</a> or <a href="http://lanyrd.com" title="Lanyrd (lanyrd.com)">lanyrd.com</a> and (assuming you’re using a modern browser) watch what happens as you resize your browser window. As the window size changes, the page’s layout morphs to accomodate the window size. CSS includes a nice feature to target styles to particular media metrics, width being one of them. In real-time, the browser will apply different styles based on the various queries defined in the stylesheet. It’s an incredibly useful feature for targeting your style not only to smaller desktop browsers but to mobile devices as well.</p>
<p><a href="/2010/12/09/css-media-queries/">Continued →</a></p></div>
</article>
<article>
<h2 class="entry-title"><a href="/2010/11/07/jquery-plugin-pattern/">jQuery Plugin Pattern</a></h2>
<div class="meta">
<p class="date">
<time datetime="2010-11-07T17:31:00-07:00" pubdate>Nov 7<span>th</span>, 2010</time>
</p>
<p class="tags">
<a class='category' href='/archive/javascript/'>javascript</a>, <a class='category' href='/archive/jquery/'>jquery</a>, <a class='category' href='/archive/patterns/'>patterns</a>, <a class='category' href='/archive/plugin/'>plugin</a>
</p>
</div>
<div class="entry-content"><p>This post is a followup to a previous post, <a href="/2010/10/30/javascript-module-pattern/" title="JavaScript Module Pattern">JavaScript Module Pattern</a>. <a href="http://docs.jquery.com/Plugins/Authoring" title="Plugins/Authoring (docs.jquery.com)">jQuery’s documentation</a> encourages developers to use JavaScript’s module pattern to create jQuery plugins. See the previous post if you’re unfamiliar with the module pattern. jQuery itself is passed to the function as its module parameter, typically as <code>$</code>. Plugins are defined within the module function by declaring functions on the <code>$</code> or <code>$.fn</code> objects. Functions declared on <code>$</code> are selector-independent and can return whatever the developer chooses. Functions declared on <code>$.fn</code> are selector-dependent and should return a jQuery object to maintain jQuery’s chainability.</p>
<p><a href="/2010/11/07/jquery-plugin-pattern/">Continued →</a></p></div>
</article>
</div>
</div>
<footer>
<nav>
<ul>
<li class="prev"><a href="/page2/">← Older</a></li>
<li class="archive"><a href="/archive">Archive</a></li>
</ul>
</nav>
</footer>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="/scripts/gist.min.js"></script>
<script>var _gaq=[['_setAccount','UA-25030121-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=true;g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s);})(document,'script');</script>
</body>
</html>