-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
893 lines (609 loc) · 71.2 KB
/
atom.xml
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Daniel Quan]]></title>
<link href="http://djquan.github.io/atom.xml" rel="self"/>
<link href="http://djquan.github.io/"/>
<updated>2013-06-17T19:56:27-04:00</updated>
<id>http://djquan.github.io/</id>
<author>
<name><![CDATA[Daniel Quan]]></name>
<email><![CDATA[[email protected]]]></email>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[User models * 2]]></title>
<link href="http://djquan.github.io/blog/2013/06/17/user-models-star-2/"/>
<updated>2013-06-17T17:57:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/17/user-models-star-2</id>
<content type="html"><![CDATA[<p>As I mentioned in my previous post, I decided to go with devise over building my own authentication system. I thought I would elaborate on that choice a little. In other tutorials, I have done my own authentication from scratch. It is often preferable because most of the authentication gems go way overboard on the features and the routes.</p>
<p>I recognize those arguments, and I chose devise for a few reasons. First, features are nice. The site will be a reflection of my skills to potential clients and HR representatives…and I’m sure many of them would be more impressed by features than rolling your own authentication system from scratch. Second, speed. I’m giving myself a week to push something to the web, and devise gives you a lot for a small amount of time. Third, and probably the biggest factor, was that I am implementing two authentication systems: one for general users (bakers) and one for organizations. Each one will have different logic associated with it (i.e, organizations will have events).</p>
<p>Today I worked more on my user model, adding a city and profile to it and the views. I also added my second model, the organizations, along with authentication for that as well. I worked a bit on the design. For a deeper understanding, check out my <a href="https://github.com/djquan/bake_sale/commits">commit history</a>. I’m trying to follow good git practices like committing constantly and working on a separate feature branch. Good habits are formed early.</p>
<p>Code Climate is pretty neat, and free for open source. It doesn’t hurt to put a project up and keep an eye out on the statistics it gives about your code. Also, I recommend checking out simplecov. It lets you know what percent your test coverage is, and even generates a nice little html report on it too.</p>
<p>I think what’s next is: events, which will belong to organizations with a has many relationship. It should be pretty simple. It’ll get more complicated with it’s relationship to bakers model, who should be able to sign up for an event. So a baker will have many events too.</p>
<p>Random thought: One of the speakers at RubyNation was a contributor to RubyGems. He made a comment about this feature that many people in the room used, and how he wrote that completely drunk.</p>
<p>Random vim newbie lesson. So, today I realized I wanted to add a generic div to most of my html files. This div would be a wrapper, and allow me to set padding on the body of most of my pages.</p>
<p>Initially, I had started off with a generic div in my application.html.erb file like this:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='erb'><span class='line'><span class="x"> <div class="main-container"> </span>
</span><span class='line'><span class="x"> </span><span class="cp"><%=</span> <span class="n">render</span> <span class="s1">'layouts/alerts'</span> <span class="cp">%></span><span class="x"></span>
</span><span class='line'><span class="x"> </span><span class="cp"><%=</span> <span class="k">yield</span> <span class="cp">%></span><span class="x"></span>
</span><span class='line'><span class="x"> </div></span>
</span></code></pre></td></tr></table></div></figure>
<p>This was great, but I needed the option of adjusting the padding specifically for my main page, as I didn’t want certain elements to have any padding at all. I’m still unsure of if there was an easier way to do it using advanced CSS skills, but I was left with the issue of adding a div to around 10 different html files.</p>
<p>This kind of repetition is where vim excels though, through it’s powerful macros. Here is how I accomplished it.</p>
<ul>
<li>qa – starts recording a macro at register a</li>
<li>gg – normalizes the position at the first line</li>
<li>O – creates a new line above the cursor (so, the first line)</li>
<li><div class=“wrapper”>[enter] – just creating the div</li>
<li>jVG – moves down one line, enters visual block mode and selects to the last line of the file</li>
<li>> – indents everything selected once</li>
<li>Go – moves cursor to last line and adds a new line</li>
<li></div>[enter] – finishes the div</li>
<li>q – quits recording</li>
</ul>
<p>This may look a little complicated, but it really wasn’t at all. Applying that change to any file was as simple as typing @a. There are even easier ways to apply the macro to a longer list of files using :argdo, but I wanted to eyeball it. For a deeper look at macros, check out Practical Vim. It definitely saved me a lot of time in this particular instance.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Building]]></title>
<link href="http://djquan.github.io/blog/2013/06/16/building/"/>
<updated>2013-06-16T15:45:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/16/building</id>
<content type="html"><![CDATA[<p>I’ve started to try and build an MVP (minimum viable product). I’m giving myself a week to make and push a fully functional rails app to the web. I’ve done a lot of programming in rails already, but it has mostly been following tutorials. I’ve been putting off building something real for lack of any great ideas. So, I’ve decided that the idea doesn’t matter, just that I build something on my own. I’m not expecting the actual site to get any users; I’m more interested in building a fully functional site to add to my portfolio.</p>
<p>My MVP is going to be based around bake sales. Yup, bake sales. The problem that my site seeks to answer is that bake sales inherently draw from the members of the organization that is running it. If there was a way for random bakers to donate their baked goods to organizations, then the organizations could do even better.</p>
<p>Even though I’m designing this site expecting to never have any real members, one question I really don’t have a solution for is how to deal with food safety/poison. Reviews would be a good place to start..but still doesn’t help with newer people? Maybe just encourage organizers to make the baker try a bite of his own food. Maybe adding a verified badge bakers can opt-in on? I guess it’s the same problem that a lot of startups like uber and airbnb face;<em> how do you prevent people will ill intent from exploiting your site?</em></p>
<p>What would the baker get out of it besides the warm and fuzzies? Ideally, the site would provide receipts for tax deductions and optionally allow the organization to “tip” the baker after the sale.</p>
<p>The repository will be evolving <a href="https://github.com/djquan/bake_sale">over here</a>, and eventually I’ll launch a functioning version. So far, I’ve only added user authentication (through devise) and implemented bootstrap.</p>
<p>Thinking about the logic required, I’ll need at least these models:</p>
<ul>
<li>Users # Bakers</li>
<li>Reviews for Users</li>
<li>Organizations</li>
<li>Bake Sales # Actual events</li>
<li>Baked goods at bake sales</li>
</ul>
<p>Random vim newbie lesson. Say you have some code like this:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt"><p</span> <span class="na">class =</span><span class="err"> </span><span class="s">"Random CSS selector"</span><span class="nt">></span>Random example<span class="nt"></p></span>
</span></code></pre></td></tr></table></div></figure>
<p>and your cursor is at the beginning of the line. How would you go about changing “Random example” to “Another scenario” in your editor? If you are using a mouse, you could always grab it, highlight “Random example”, and start typing “Another scenario”. That doesn’t require too much energy or time.</p>
<p>In vim, it’s even simpler. The keystrokes would be “citAnother scenario<CR>”. No need to go to the mouse, no ned to navigate to it. “it” is a text object for anything inside tags. By pressing “cit”, you are telling vim to change inside the tags and it automatically puts you in insert mode. Text objects are great, and they are one of the reasons I use vim.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Ruby Nation, Day II]]></title>
<link href="http://djquan.github.io/blog/2013/06/15/rubynation-day-ii/"/>
<updated>2013-06-15T12:21:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/15/rubynation-day-ii</id>
<content type="html"><![CDATA[<p>Kerri Miller spoke about measurement tools. Slides <a href="https://speakerdeck.com/kerrizor/you-cant-miss-what-you-cant-measure">here</a>. An interesting tool is <a href="http://ruby.sadi.st/Ruby_Sadist.html">flog</a> which grades you based on code complexity. Aside from code complexity, another metric to keep an eye out on is churn. Churn, from what I understand, is the amount of times you edit a file. If you keep on editing a file throughout a project’s lifespan, you may not have a firm understanding on what that model/class/method should be doing.</p>
<p>Rich Kilmer spoke about Ruby Motion and Bluetooth 4 integration in Ruby Motion. Ruby Motion definitely seems 1.) capable and 2.) an emerging technology with an active community. I definitely want to start writing some programs in it. The second half of his talk was about Bluetooth 4: BT4 is really a cool technology with a lot of cool potential. We will start seeing more electronics and gadgets incorporating it, especially since iOS 7 is embracing more of the advanced capabilities of it.</p>
<p>Jim Gay spoke about DCI; this may have been one of the only talks that really went over my head. DCI stands for Data-Context-Interaction. On paper, I understand the basics of DCI. I’m just unsure of how to implement it in web development, and even if I should be worrying about that as a beginner.</p>
<p>Evan Light spoke, somewhat pessimistically, about the state of ruby and ROR. He compared Rails’ current state to where Java was leading up to the moment when people started leaving java for ruby. He spoke about how complex things are becoming and how the community seems to be making some dangerous choices on what gems and technologies are adopted. Overall, it was pretty interesting; it was clear he really loves ruby and doesn’t want it to see the same fate as java.</p>
<p>John Athayde spoke about design patterns. I enjoyed his talk a lot. He has an interesting background; he comes from, among other things, a career as an architect. Developers, for good reasons, like to think of themselves as craftsman and engineers. His talk focused on architectural theory that could be applied to development. Mainly, in architecture, there are common patterns (like in programming). These patterns are not a template though, they are an answer to a problem. He also stressed that beginners should focus on code anti-patterns (code smells) rather than code patterns. Otherwise, beginners will jump straight to copying a pattern when they might not.</p>
<p>A lot of the lightning talks were really well done. One that sticks out was an introduction to devops. Basically, the speaker said that many people use the word wrong. Devops is a culture of getting developers and system operators to work together and improve the final product.</p>
<p>Steve Klabnik spoke about taking over maintenance of an open source project under the worst conditions. It was a good talk, but one thing I particularly enjoyed that he said was <em>getting</em> involved in an open source project as a beginner is not easy. Many current developers that do open source work say that it is, but there are still barriers to knowing where to begin with it. Moreover, he also spoke about the negative side of the open source community ~ high demands. Many people expect your programming to be perfect, but 1.) they aren’t committing to it and 2.) You aren’t getting paid to do it.</p>
<p>Avdi Grimm ended RubyNation with an awesome talk on code and joy. Two things that he talked about were 1.) the community and 2.) pair programming. The ruby community is amazing. My experience with this conference, and with all the resources online, really convinced me that there aren’t many programming communities out there like this, let alone regular communities. I felt so comfortable just going up to random strangers and introducing myself in a way that I have never before.</p>
<p>I am so thankful for the people organizing RubyNation; it was a great conference with well selected and engaging speakers.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Ruby Nation, Day I]]></title>
<link href="http://djquan.github.io/blog/2013/06/14/ruby-nation/"/>
<updated>2013-06-14T16:53:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/14/ruby-nation</id>
<content type="html"><![CDATA[<p>The first day of RubyNation is done, and I thought I’d post some things I learned.</p>
<p>Sandi Metz did her talk on the magic tricks of testing; you really should check a <a href="http://www.confreaks.com/videos/2452-railsconf2013-the-magic-tricks-of-testing">version</a> of it out. She, and her book, are amazing for programmers of any level. This talk is solely on unit testing. She stresses not over-testing and not repeating test coverage.</p>
<ul>
<li>Test that your objects, when they receive a query or command, respond to them appropriately.</li>
<li>Don’t test private methods. If you need to, don’t get attached to them; delete them when they break.</li>
<li>Test that your object sends a particular command; not exactly the consequences of it as another object will test the side-effects.</li>
<li>Don’t test methods that an object sends to itself. Don’t test queries that an object sends to another.</li>
</ul>
<p>Really, check out her talk(and her book!). It’s quite good. I particularly like the analogy of objects as space capsules.</p>
<p>Russ Olsen launched RubyNation with an interesting talk on intuition and those “Aha!” moments. He talked a little bit about pair programming, including a nice little rule:</p>
<ul>
<li>if your pair and you are stuck, sit in quiet and don’t type for two minutes while thinking through the problems.</li>
</ul>
<p>He also discussed another profession that works in pairs in the same manner: police officers. As a former police officer, I could definitely appreciate the comparison. For a lot of my time with the department, I worked directly with a partner. We were much more effective as a team than independently.</p>
<p>Emily Stolfo had a nice <a href="http://www.confreaks.com/videos/2493-railsconf2013-hacking-the-academic-experience">talk</a> on hacking the academic experience where she listed five traits she tries to teach students:</p>
<ul>
<li>Use the internet as a textbook</li>
<li>Able to debug code you didn’t write</li>
<li>Build something to solve a real-life problem</li>
<li>Engage with the community</li>
<li>Think critically about code</li>
</ul>
<p>There were a few other memorable talks. Bryan Helmkamp spoke about security in rails applications. He recommends the <a href="http://brakemanscanner.org/">Brakeman gem</a> for checking vulnerabilities. It reviews your code for common (but not all) vulnerabilities.</p>
<p>Two people spoke about doing DevOps on President Obama’s re-election campaign. Learning about the technologies that went into the campaign was interesting. It was more from the perspective of a system administrator than a developer, but I still found it helpful in understanding how sites scale. I’ve been focusing on code for the past four months, and it’s easy to forget that code is run on machines. Heroku is fine for playing around with and learning (and it’s fine for production environments too), but there are other options and technical considerations when developing a site/application that will actually receive heavy traffic.</p>
<p>I learned a lot, and day two should be just as great. Some final thoughts</p>
<ul>
<li>Don’t be afraid to say you’re a complete beginner. Most people are friendly and want to help.</li>
<li>There are a lot of freelancers out there making a living off contracts ~ Most said that it was really easy to get contracts.</li>
<li>Be friendly and introduce yourself to people.</li>
<li>I’m doing better with imposter syndrome. It’s easy to think you don’t have the skills to belong at the table, but everyone is learning something. Some people happen to be learning more.</li>
<li>It wouldn’t be the worst idea to take handwritten notes.</li>
</ul>
<p>Random unrelated vim tip:</p>
<figure class='code'><figcaption><span>Press ctrl-l after a search is complete to turn off highlighting. From Practical Vim. </span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="nb">nnoremap</span> <span class="p"><</span><span class="k">silent</span><span class="p">></span> <span class="p"><</span>C<span class="p">-</span><span class="k">l</span><span class="p">></span> :<span class="p"><</span>C<span class="p">-</span><span class="k">u</span><span class="p">></span><span class="k">nohlsearch</span><span class="p"><</span>CR<span class="p">><</span>C<span class="p">-</span><span class="k">l</span><span class="p">></span>
</span></code></pre></td></tr></table></div></figure>
<p><img src="https://dl.dropboxusercontent.com/u/6565481/rubynation.jpg" alt="RubyNation" /></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[More Mobile]]></title>
<link href="http://djquan.github.io/blog/2013/06/13/more-mobile/"/>
<updated>2013-06-13T16:00:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/13/more-mobile</id>
<content type="html"><![CDATA[<p>Just a brief review on Code School’s first two courses on iOS development. I definitely believe that they are worth the time. Objective C and mobile development is new for me, and it was fairly challenging to start off learning a new language (especially one that wasn’t as intuitive as ruby). Still, like most challenges, I began to understand it better the more effort I put in.</p>
<p>The technology behind the courses is impressive. Compiling Objective C/iphone code seems more challenging than compiling ruby code. Code School has it set up so that their machines build and compile your code. This lets non-mac users actually experiment with iOS development. It also means that it takes a few seconds to see if you made any errors (which was slightly annoying, but also made me double check my code before hitting submit).</p>
<p>I’ve also updated the resources section of the site. It’s a categorized list of the resources I’ve used so far. Definitely check it out, and feel free to suggest other resources in the comments.</p>
<p>Ruby Nation is tomorrow!</p>
<p>Log</p>
<ul>
<li>Code School – Try Objective C</li>
<li>Code School – Try iOS</li>
<li>Code School – Git Real 2</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Objective C]]></title>
<link href="http://djquan.github.io/blog/2013/06/11/objective-c/"/>
<updated>2013-06-11T12:57:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/11/objective-c</id>
<content type="html"><![CDATA[<p>I’ve been struggling a little bit with getting into Objective C. Ruby is really a fun language to program in, and that was one of the goals it was designed for. I’m really appreciating that more as I dive a little into Objective C. Granted, it is only through the Code School tutorial, so there may be other best practices and ways to do it that actually make it better. Take for example functions. This is an example from the tutorial:</p>
<figure class='code'><figcaption><span>TalkingiPhone.h (header)</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="k">@interface</span> <span class="nc">TalkingiPhone</span> : <span class="nc">NSObject</span>
</span><span class='line'>
</span><span class='line'><span class="k">@property</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">phoneName</span><span class="p">;</span>
</span><span class='line'><span class="k">@property</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">modelNumber</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'><span class="k">-</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">speak:</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">greeting</span><span class="p">;</span>
</span><span class='line'><span class="k">@end</span>
</span></code></pre></td></tr></table></div></figure>
<figure class='code'><figcaption><span>TalkingiPhone.m (implementation)</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="cp">#import "TalkingiPhone.h"</span>
</span><span class='line'>
</span><span class='line'><span class="k">@implementation</span> <span class="nc">TalkingiPhone</span>
</span><span class='line'><span class="k">-</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">speak:</span><span class="p">(</span><span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">greeting</span><span class="p">;</span>
</span><span class='line'><span class="p">{</span>
</span><span class='line'> <span class="n">NSString</span> <span class="o">*</span><span class="n">message</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSString</span> <span class="nl">stringWithFormat:</span><span class="s">@"%@ says %@"</span><span class="p">,</span> <span class="n">self</span><span class="p">.</span><span class="n">phoneName</span><span class="p">,</span> <span class="n">greeting</span><span class="p">];</span>
</span><span class='line'>
</span><span class='line'> <span class="k">return</span> <span class="n">message</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'><span class="k">@end</span>
</span></code></pre></td></tr></table></div></figure>
<p>This just seems really verbose and not intuitive. I mean, the whole thing in ruby could be as simple as:</p>
<figure class='code'><figcaption><span>talkingiPhone.rb</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">class</span> <span class="nc">TalkingiPhone</span>
</span><span class='line'> <span class="k">def</span> <span class="nf">initialize</span> <span class="nb">name</span>
</span><span class='line'> <span class="vi">@phoneName</span> <span class="o">=</span> <span class="nb">name</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="k">def</span> <span class="nf">speak</span> <span class="n">greeting</span>
</span><span class='line'> <span class="n">message</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="vi">@phoneName</span><span class="si">}</span><span class="s2"> says </span><span class="si">#{</span><span class="n">greeting</span><span class="si">}</span><span class="s2">"</span> <span class="c1"># "message = " is optional, but I kept it in.</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>That’s much more simple, right? No confusing syntax…no need for explicit variable declarations with type.</p>
<p>Of course the entire code example is trivial in its functionality; but I’m sure the point is even more valid the more complex the program will get.</p>
<p>Objective C is still a valuable language to be familiar with, and I fully intend to keep pushing forward on it. I do want to play around with Ruby Motion, but you still need to know your way around objective c for it(since you can use the same APIs and libraries).</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Vim and Me]]></title>
<link href="http://djquan.github.io/blog/2013/06/08/vim-and-me/"/>
<updated>2013-06-08T15:31:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/08/vim-and-me</id>
<content type="html"><![CDATA[<p><strong>Introduction</strong></p>
<p>vim is a text editor, but it is so much more too. This post will go over why vim works <em>for me</em> and my setup, including plugins.</p>
<p>This post will be similar to my <a href="http://quan.io/blog/2013/05/14/tmux/">post on tmux</a>, with an emphasis on the plugins I use and how they fit into my workflow. I am a beginner; I still have a tremendous amount of learning about vim, <em>and this post is for fellow beginners out there.</em></p>
<p>This is also not a “vim is better than sublime/emacs/textmate/eclipse/rubymine” post. This is just me laying out some thoughts on my experience with vim and my setup.</p>
<p>This is not a guide on how to use vim. Check out some of the links at the bottom for some good resources. The <em>best</em> resource on vim (that I have found) is Practical Vim by Drew Neil.</p>
<p>Moreover, this is also serving as a way to downsize my vimrc file by justifying everything in it.</p>
<p>My recommendation is, no matter what editor you use, think about how to improve your workflow and become more efficient. Is there a way you can do what you want with less keystrokes? Do you really need to reach for the mouse? What plugins are your favorite, and are you using them in the best way? How can you make your editor leaner?</p>
<p><img src="https://dl.dropboxusercontent.com/u/6565481/vim.png" alt="vim" /></p>
<p><strong>Does a beginner really need to use vim?</strong></p>
<p>No, of course not. I came to vim only after I felt comfortable with ruby, looking to improve my workflow. My advice: make sure you have that some comfort with whatever language(s) you chose before experimenting with vim.</p>
<p>That said, learning vim early can do a few good things. So you made a mistake and didn’t press a or i to enter insert mode to begin typing. Well, you can retype it again and have the added bonus of repetition in learning the basics. You also get the baby-steps and issues of learning vim out of the way, so that when you <em>need</em> to be typing fast with few mistakes, you can. To put it another way, make your mistakes now in both vim and #{whatever programming language you are learning} so that you won’t make them later.</p>
<p><strong>Why should I even bother?</strong></p>
<ul>
<li>Efficiency – Modal editing, despite taking a while to get a hang of, can lead to improving efficiency. The mouse, while typing, is the enemy. The time it takes to move between the mouse and keyboard can add up.</li>
<li>The Dot command – Vim knows what you did last. Actions, like adding text, deleting lines, can be repeated by pressing . on your keyboard. This is extremely powerful in programming, where often you need to repeat an action.</li>
<li>Text Objects – Text objects, when combined with modal editing, are great. Say I’m typing a sentence, and I want to rewrite the entire thing. I can press cis anywhere in that sentence to delete it all and throw me into insert mode. They are pretty cool.</li>
<li>Editing text on a server – If you haven’t already, someday soon any beginner will eventually get to the point where he has to edit text on a server. That server will have vim on it. Any investment, even if you chose to edit with something else primarily, in learning vim can pay off when that comes up.</li>
<li>Command line – Even without tmux, it is easy to use the command line and all of it’s power from the editor itself.</li>
<li>Vim + Tmux = Amazingness</li>
</ul>
<p><strong>Plugins</strong> (in no particular order)</p>
<p><em><a href="https://github.com/gmarik/vundle">Vundle</a></em>:
Vundle is a plugin manager. Basically, installing a plugin with it involves adding ‘Bundle “github/pathofplugin”’ to your vimrc file, and typing :BundleInstall in vim (after reloading your source file). Use this or Tim Pope’s <a href="https://github.com/tpope/vim-pathogen">Pathogen</a> for managing your plugins. Both are great.</p>
<p><em><a href="https://github.com/kien/ctrlp.vim">Ctrl-P</a></em>:
Ctrl-P is a fuzzy file finder for vim. It is quick and efficient. It’s much more efficient than “:e filename.rb” and is my preferred method of finding files.</p>
<p><em><a href="https://github.com/godlygeek/tabular">Tabularize</a></em>:
Tabular makes it easy to align text based on a target. There is a nice <a href="http://vimcasts.org/episodes/aligning-text-with-tabular-vim/">vimcast</a> that does a great job explaining this. Basically, if I wanted to align text for variable assignment based on an equal sign, I could just type :Tab /= and all of the equal signs would be aligned in the same column.</p>
<p><em><a href="https://github.com/tpope/vim-unimpaired">Unimpaired</a></em>:
Unimpaired provides handy shortcuts for switching between buffers/args/etc. Instead of pressing “:bn” to get to the next buffer, unimapired allows you to press [b to get to the next buffer.</p>
<p><em><a href="https://github.com/benmills/vimux">vimux</a></em>:
Allows easy integration with tmux. Bind a leader combo to open up a new tmux pane and run a command in it. Amazing. Also, amazing in conjunction with vim-turbux.</p>
<p><em><a href="https://github.com/jgdavey/vim-turbux">vim-turbux</a></em>:
See above, automates the process of testing in conjunction with tmux.</p>
<p><em><a href="https://github.com/tpope/vim-endwise">vim-endwise</a></em>:
Adds “end” wherever it needs be automatically. class, def, if, it should do; can handle them all and more.</p>
<p><em><a href="https://github.com/townk/vim-autoclose">vim-autoclose</a></em>:
Autocloses parenthesis, brackets, quotes, single quotes, backticks, etc. Helpful.</p>
<p><em><a href="https://github.com/jeffkreeftmeijer/vim-numbertoggle">vim-numbertoggle</a></em>:
This one has grown on me. I like relative number for ease of navigating. Relative number lets me not have to count as much. I don’t need relative number on all the time, and numbertoggle switches between them when I go into insert mode.</p>
<p><em><a href="http://github.com/mattn/gist-vim">gist-vim</a></em>:
This one I don’t use enough to have anything memorized. But it is there, and allows easy code sharing when I need it.</p>
<p><em><a href="https://github.com/tpope/vim-fugitive">vim-fugitive</a></em>:
An amazing plugin; if you are a heavy git user, this alone might be enough to make you switch to vim. <a href="http://vimcasts.org/episodes/fugitive-vim---a-complement-to-command-line-git/">Vimcasts</a> has a nice set of tutorials on using fugitive. The short of it is: vim-fugitive gives you the history(through git) on changes, files, and commits. Typing :Gdiff opens up a split pane with a line by line colored comparison of changes I have made to a file.</p>
<p><em><a href="https://github.com/epmatsw/ag.vim">ag</a></em>:
The vim plugin for integrating the silver searcher. The Silver Searcher is a replacement for Ack, which is often used instead of grep. This plugin gives you a nice popup menu for ag searches by typing :Ag “searchterm”<CR></p>
<p><em><a href="https://github.com/tpope/vim-rails">vim-rails</a></em>:
This plugin is obviously only good for those rails developers out there. Enhanced syntax highlighting is nice, but just the tip. Vim-rails has ways of easily and intelligently navigating the directory ~ it knows your controllers, your models, and your views. There are more features, but I’m still learning them.</p>
<p><em><a href="https://github.com/scrooloose/syntastic">vim-syntastic</a></em>:
Points out syntax errors. On write(:w), it’ll check and throw arrows in the margin of lines it thinks there’s issues with. These issues could be a number of things that it thinks is wrong.</p>
<p><em><a href="https://github.com/tpope/vim-surround">vim-surround</a></em>:
Another fantastic plugin by Tim Pope. Say I wanted to change a string declaration from a = “hello” to a = ‘hello’. I just place my cursor on any letter in hello and type cs”‘ and it changes it automatically. Especially helpful with changing HTML tags since you can replace things with valid html. It can also add (instead of just changing) with ys[textobject][whatever you want to add].</p>
<p><em><a href="https://github.com/mattn/zencoding-vim">zencoding</a></em>:
Zencoding/Emmet is a way of expanding short bits of code into longform html. Definitely check out the video here, <a href="http://docs.emmet.io/">http://docs.emmet.io/</a> . It’s an extremely efficient way of writing html.</p>
<p>I probably still need a good snippet tool. I’m looking at ultisnip or snipmate; I haven’t really felt the need to have one <em>yet</em>. Vim-Autoclose and endwise help a lot already. Zencoding handles much of my html needs.</p>
<p><strong> Some helpful .vimrc lines </strong></p>
<p>I’m pretty sure I got all of these from Drew Neil.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="c">" Easy expansion of filepath. Type %% in command mode and it puts your current directory</span>
</span><span class='line'>cnoremap <span class="p"><</span>expr<span class="p">></span> %% getcmdtype<span class="p">()</span> <span class="p">==</span> <span class="s1">':'</span> ? expand<span class="p">(</span><span class="s1">'%:h'</span><span class="p">)</span>.<span class="s1">'/'</span> : <span class="s1">'%%'</span>
</span><span class='line'>
</span><span class='line'><span class="c">"Reloads source file on save</span>
</span><span class='line'><span class="k">if</span> has<span class="p">(</span><span class="s2">"autocmd"</span><span class="p">)</span>
</span><span class='line'> autocmd bufwritepost .vimrc source $MYVIMRC
</span><span class='line'><span class="k">endif</span>
</span><span class='line'>
</span><span class='line'><span class="c">"Leader - v to open sourcefile</span>
</span><span class='line'>nmap <span class="p"><</span>Leader<span class="p">></span><span class="k">v</span> :<span class="k">vsp</span> $MYVIMRC<span class="p"><</span>CR<span class="p">></span>
</span><span class='line'>
</span><span class='line'><span class="c">" adds dot command to visual mode </span>
</span><span class='line'><span class="nb">vnoremap</span> . :norm.<span class="p"><</span>CR<span class="p">></span>
</span></code></pre></td></tr></table></div></figure>
<p><strong>Negatives</strong></p>
<p>There is no getting around it: Vim has a learning curve. However, it may not be as steep as you think. It may take a few days for the basic ideas of normal/insert/visual/etc modes to click. Navigating may be tricky at first. You may find yourself wishing that you had a mouse on many occasions. But it passes, and you gain efficiency eventually.</p>
<p>Vim requires out of the box work to get it configured. This is only a negative in the short-term. In the long term, you have a better understanding of the features in your text editor because you worked to get them there. I also feel that the small decisions I make in setting it up add up to really make the vim I work on unique and ‘mine.’</p>
<p>I can’t remember where I heard it from(I think it was the peepcode screencast on vim), but someone said that your .vimrc file is something you can grow old with. Someone also said that if you don’t think your .vimrc is the best there is, you need to work on it more.</p>
<p><strong>Conclusion</strong></p>
<p>Vim is a highly customizable text editor. Getting it set up is an extremely personal ordeal, and I would recommend against using packages that advertise to be the ultimate vim distribution. One of the great things about vim is that at the end of the day, you are left with an editor that is <em>yours</em>. Get to know your plugins. Get to know every setting you have and what it does. This will help you get the most out of it.</p>
<p>If I haven’t convinced you to try vim, I hope I have convinced you to:</p>
<ul>
<li>Love what editor you do use (we spend enough time on them that this is crucial)</li>
<li>Think of ways you can improve it</li>
<li>Think of ways you can be more efficient</li>
</ul>
<p>There are probably countless amazing plugins I haven’t mentioned. My recommendation: don’t get caught up in all the “what plugin” should I use for x until a little later. Learn the vim basics, and then go plugin-crazy. Vim is awesome without plugins; plugins just make it that much more amazing.</p>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://pragprog.com/book/dnvim/practical-vim">Practical Vim</a> ($)</li>
<li><a href="http://mislav.uniqpath.com/2011/12/vim-revisited/">Vim Revisted</a></li>
<li><a href="http://vimcasts.org">Vimcasts</a></li>
<li><a href="http://vimcasts.org/classes/core-vim">Vim Masterclass</a> ($$)</li>
<li><a href="http://vim-adventures.com/">Vim Adventures</a></li>
<li><a href="https://learn.thoughtbot.com/products/2-vim-for-rails-developers">Vim for Rails Developers</a>($$)</li>
<li>Vimtutor (Type vimtutor in your shell)</li>
<li>Peep Code has a couple screencasts on vim; I would recommend just watching any of the play by plays (many/most of them use vim). Ben Orenstein’s, in particular, is pretty great on SO many levels. He also has a <a href="http://www.youtube.com/watch?v=SkdrYWhh-8s">pretty good talk</a> on developing in vim.</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Design]]></title>
<link href="http://djquan.github.io/blog/2013/06/07/update/"/>
<updated>2013-06-07T14:19:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/07/update</id>
<content type="html"><![CDATA[<p>I’ve started to dive into some more design resources.</p>
<p>Code School’s Journey into Mobile is a pretty good introduction to responsive design. Responsive design is designing your site so that it looks good in varying resolutions and devices. It is extremely important with the variety of ways people can visit a site. It involves using percentages or ems (relative units in css). Also, it involves finding “break points”, resolutions which the site design changes. All in all, it was eye opening at the amount of thought and work that it takes to make a site responsive; especially since tools like Twitter’s Bootstrap can hide all the magic of responsive design.</p>
<p>Sass is stylesheet language that compiles into CSS. It lets you do more with less lines of code. It’s similar to CoffeeScript, in the sense that it 1.) simplifies the syntax and 2.) makes it feel more like a programming language. For example, the text below is in Sass.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='sass'><span class='line'><span class="nv">$authors</span><span class="o">:</span> <span class="n">bob</span> <span class="n">tim</span> <span class="n">sue</span> <span class="n">kate</span>
</span><span class='line'><span class="nc">.author</span>
</span><span class='line'> <span class="na">float</span><span class="o">:</span> <span class="no">left</span>
</span><span class='line'> <span class="na">width</span><span class="o">:</span> <span class="mi">100</span><span class="kt">%</span> <span class="o">/</span> <span class="nf">length</span><span class="p">(</span><span class="nv">$authors</span><span class="p">)</span> <span class="c1">// automatically updates if $authors changes</span>
</span></code></pre></td></tr></table></div></figure>
<p>$authors is a list, which functions much like an array. You can iterate through it using each, find the index of a value, and many more commands you’d expect from an array. The example above automatically updates the width of a css selector (.author) to adjust to adding new authors.</p>
<p>Log</p>
<ul>
<li>Thoughtbot – Completed Test Driven Rails Workshop</li>
<li>Thoughtbot – Design for Developers Workshop, Principles of Visual Design</li>
<li>Code School – Assembling Saas, Part I</li>
<li>Code School – Assembling Sass, Part II</li>
<li>Code School – Journey into Mobile</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[and back]]></title>
<link href="http://djquan.github.io/blog/2013/06/03/and-back/"/>
<updated>2013-06-03T16:43:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/06/03/and-back</id>
<content type="html"><![CDATA[<p>Back to learning!</p>
<p>I recommend checking out the Ruby Rogues episode on imposter syndrom. As someone new to programming, it’s nice to hear that even the experts can feel like they don’t belong or people will realize that they don’t know as much as they should.</p>
<p>I attended Spree Conf in DC; and I definitely felt that I didn’t belong, and that created a lot of fear and anxiety. I’ve been studying for over four months, and I’m fairly accomplished in other areas, but it was still terrifying to be that new person in the room. This RubyRogues episode definitely has helped my outlook, and I’m excited to go to my next conference (RubyNation!).</p>
<p>I recently attended a webinar on vim by Drew Neil, the man who wrote <em>Practical Vim</em>. I definitely recommend attending; it is easily worth the relatively steep price. I’d read (or skim) the book and check out some of his vimcasts beforehand to get the most out of it. The major focus points were: Macros and text objects, but I also feel more comfortable just dealing with registers, buffers, and args.</p>
<p>vim helpful tip for your .vimrc. This lets you use the dot command in visual mode. Great for applying the last change on many lines.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="c">" adds dot command to visual mode "</span>
</span><span class='line'><span class="nb">vnoremap</span> . :norm.<span class="p"><</span>CR<span class="p">></span>
</span></code></pre></td></tr></table></div></figure>
<p>Say you wanted to add a semicolon to multiple lines.</p>
<p>A; ~ Appends a semicolon to the current line</p>
<p>vG ~ Selects to the last line of the file, could easily be a different selector.</p>
<p>. ~ Appends a semicolon to every line selected.</p>
<p>No idea why this doesn’t work out of the box for vim.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Node.js and more]]></title>
<link href="http://djquan.github.io/blog/2013/05/25/updates/"/>
<updated>2013-05-25T21:47:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/25/updates</id>
<content type="html"><![CDATA[<p>This will probably be my last update for about a week. I’m driving cross country on monday, so I won’t have too much time to update the blog. I do plan on learning more through various audio podcasts during the drive. Some of them include:</p>
<ul>
<li>The Changelog</li>
<li>RubyRogues</li>
<li>Giant Robots Smashing into Other Giant Robots</li>
<li>Ruby Freelancers</li>
<li>Javascript Jabber</li>
</ul>
<p>Feel free to post suggestions in the comments section. Learning to program is inherently visual and tactile, but there must be some other good audio only resources out there. It is too bad there aren’t many audio versions of technical books.</p>
<p>I’ve written a bit on Thoughtbot’s Learn Prime. This week, they had a pretty awesome “Ask Me Anything” session with Ben Orenstein. More features like this would definitely make Learn Prime appealing after I have finished all of their workshops.</p>
<p>I’ve signed up for an online <a href="http://vimcasts.org/classes/core-vim">vim seminar</a> on June 3rd that should raise my vim skills to the next level. I’ll be sure to post my thoughts on that.</p>
<p>Web development is much more than knowing how to write a Ruby on Rails app. Learning javascript well is becoming a major priority for me. Javascript isn’t the prettiest language, but a lot of the exciting frameworks (backbone, ember, node, angular) rely on it.</p>
<p>Node.js is a server-side system of responding to events quickly and reliably. I definitely recommend the Code School course on it. It was one of the more challenging courses, and I learned more because of that.</p>
<p>Log for 5/23 – 5/25</p>
<ul>
<li>Code School – Real Time Web with Node.js</li>
<li>Thoughtbot – Test Driven Rails, Interacting with 3rd Party Services</li>
<li>Code School – Discover Dev Tools</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[progress]]></title>
<link href="http://djquan.github.io/blog/2013/05/22/progress/"/>
<updated>2013-05-22T17:47:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/22/progress</id>
<content type="html"><![CDATA[<p>The RubyNation <a href="http://www.rubynation.org/schedule">Speaker List</a> looks amazing. Sandi Metz, Avdi Grimm, Russ Olsen, Steve Klabnik…I’m definitely excited about it.</p>
<p>CoffeScript is a language that compiles into javascript. The Code School course on CoffeeScript was a nice introduction to it, and it was also a good refresher on basic javascript. The course has a lot of examples of translating from javascript and jquery into pure coffeescript, which I found really helpful.</p>
<p>There is a lot <a href="http://wekeroad.com/2012/03/21/coffeescript-or-straight-up-js-i-suck-either-way/">written</a> about the pros and cons of CoffeeScript weighed against pure JavaScript. I do like that CoffeeScript appears to be more similar in syntax to Ruby. I don’t look it as a JavaScript vs CoffeeScript choice. To write well in CoffeeScript, you need to have a firm understanding of basic JavaScript to debug errors and really understand what’s going on.</p>
<p>Recently, I’ve done a fair amount of coding(and blogging) using vim exclusively, and I’ve been thrilled with how it’s going. I’ve improved my efficiency by not having to switch windows to perform tests, rake tasks, or any other command line work. Moreover, being able to work quickly without using the mouse at all is liberating.</p>
<p>I’m still reading through <a href="http://pragprog.com/book/dnvim/practical-vim">Practical Vim</a>, and it’s been a great resource so far. I still need to learn more about registers (vim’s tools to copy and paste). I also still need to find a snippet(ways of expanding text) solution that works well for me. Still, I can’t see myself moving away from vim+tmux anytime soon.</p>
<p>Log for 5/20 – 5/22</p>
<ul>
<li>Finished the Jumpstart Labs EventManager Tutorial</li>
<li>Thoughtbot – Test Driven Rails, Writing Unit Tests</li>
<li>Code School – Anatomy of Backbone.js Part 2</li>
<li>Code School – CoffeeScript</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Law and Development]]></title>
<link href="http://djquan.github.io/blog/2013/05/19/progress/"/>
<updated>2013-05-19T18:17:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/19/progress</id>
<content type="html"><![CDATA[<p>The Ruby Rogues episode on <a href="http://rubyrogues.com/105-rr-regular-expressions-with-nell-shamrell/">regular expressions</a> is pretty awesome. Regular expressions are a way to express patterns in a programming language. Regular expressions are powerful, but can be very intimidating. <a href="http://rubular.com">Rubular</a> is a nice tool to play around with them, and the chapter on regular expressions in <em>The Well Grounded Rubyist</em> provides a great explanation.</p>
<p>I passed the CA bar exam! That being said, landing a job as a web developer is still my number one goal. Being a lawyer will be just another skill that I bring to the table. This means that I’ll need to find resources to learn about laws and regulations that affect start-ups. Being a web developer that can also handle routine and simple legal issues will help me stand out. Web Developer / Counsel would be a nice job title.</p>
<p><a href="http://www.lawline.com/">Lawline</a> might be a good resource to learn more. I tried a course on them about negotating SaaS deals which was pretty informative. A general theme of the video was to be explicit about every provision, including confidentiality and ownership. The instructor also stated that the majority of contracts created by tech vendors are pretty horrible because companies tend to reuse old contract and they aren’t clear on the intent of the agreement.</p>
<p>Heads up, Code School will be <a href="http://www.codeschool.com/free-weekend?fb_action_ids=10201128707883052&fb_action_types=og.likes&fb_ref=.UZaSvvvXBpk.send&fb_source=aggregation&fb_aggregation_id=288381481237582">free</a> May 25th to May 26th. Code School is a fantastic <em>starting off point</em> for many topics. Their courses are always well made and designed.</p>
<p>Log for 5/17-5/19</p>
<ul>
<li>Lawline.com – The Art and Science of Negotiating SaaS(Software as a service) Deals</li>
<li><a href="http://www.youtube.com/watch?v=T8J0j2xJFgQ">Confident Code</a> talk by Avdi Grimm</li>
<li>Ruby Rogues – Episode 105, Regular Expressions with Nell Shamrell</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[relative numbers]]></title>
<link href="http://djquan.github.io/blog/2013/05/16/progress/"/>
<updated>2013-05-16T14:14:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/16/progress</id>
<content type="html"><![CDATA[<p>One of the great things about the ruby (and software community in general) is that there are a lot of resources available to learn from.</p>
<p><a href="http://destroyallsoftware.com">Destroy All Software</a> has just made the screencasts available for purchase by season. They weren’t available for the past few months while Gary Bernhardt switched pricing models. I’m working through the first season right now and am learning a lot. It’s almost worth it alone to see how fast and efficient he is with vim.</p>
<p>Vim tip: Relative numbers is a <a href="http://forum.thoughtbot.com/t/give-set-relativenumber-a-try/22">winner</a>.</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='vim'><span class='line'><span class="k">set</span> <span class="nb">relativenumber</span>
</span></code></pre></td></tr></table></div></figure>
<p>I like using the <a href="https://github.com/jeffkreeftmeijer/vim-numbertoggle">numbertoggle</a> plugin. It automatically switches to absolute numbers when I switch to insert mode, and it switches back to relative numbers when I leave.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Octopress]]></title>
<link href="http://djquan.github.io/blog/2013/05/16/octopress/"/>
<updated>2013-05-16T13:33:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/16/octopress</id>
<content type="html"><![CDATA[<p>Well, the switch to Octopress seems pretty complete. Here are just a few of my thoughts on it.</p>
<p>Give octopress a try. It’s easy to set up. It’s easy to post content.</p>
<ul>
<li>Octopress makes it incredibly easy to write and publish from the command line.</li>
<li>Everything about an octopress blog will be stored locally.</li>
<li>This gives freedom to switch publishing platforms or web hosts and a local backup of posts(with version control!).</li>
<li>Octopress is made for coders. Inserting code snippets is incredibly easy. There are also a large number of plugins to extend functionality.</li>
</ul>
<p>I will miss some aspects of tumblr.</p>
<ul>
<li>Tumblr is an incredible way to make connections and really is social blogging at its best.</li>
<li>Tumblr has apps to make mobile publishing simple.</li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Migration from Tumblr]]></title>
<link href="http://djquan.github.io/blog/2013/05/15/migration-from-tumblr/"/>
<updated>2013-05-15T15:31:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/15/migration-from-tumblr</id>
<content type="html"><![CDATA[<p>I will slowly be making a move from tumblr to octopress.</p>
<p>Octopress is a framework built on Jekyll, a static blog generator.</p>
<p>I think as I get more familiar with it, the switch to octopress will allow me a greater ability to customize the site.
Moreover, octopress (and jekyll) allow me a greater freedom in how I write my posts.</p>
<p>I have been trying for the past few hours on ways of importing my older posts from tumblr. I’ve tried a variety of methods, including <a href="http://jekyllrb.com/docs/migrations/">jekyll-import</a>
but have run into issues. I’ll keep playing around with it though!</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[tmux]]></title>
<link href="http://djquan.github.io/blog/2013/05/14/tmux/"/>
<updated>2013-05-14T15:55:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/14/tmux</id>
<content type="html"><![CDATA[<p><strong>Intro to tmux</strong></p>
<p>tmux is a terminal multiplexer. At it’s most basic, it allows you create windows and panes inside a tmux session. Each window and pane is a separate instance of a terminal. </p>
<p>I’ll try to explain why tmux works <em>for me</em>, and I’ll finish with links on how to set it up. </p>
<p>This is not aimed to be a guide on setting up tmux, or how to use tmux. It is just an explanation of why it has become essential<em> to me</em>, and why it is worth a try. There are alternatives; iterm2 has it’s own way of handling panes; there is also screen. I haven’t tried either, and I’m not implying that tmux is better than either. </p>
<p><span>Also, I am still a novice; I have a tremendous amount to learn about improving my workflow.</span></p>
<p><a href="https://dl.dropboxusercontent.com/u/6565481/tmux.png"><img alt="image" src="http://media.tumblr.com/7ca4b1bdf4c5fb7d5ab1d5dfe10cad9a/tumblr_inline_mmt29dEyHR1qz4rgp.png" /></a></p>
<p><strong>Panes, Panes, Panes.</strong></p>
<p>Since I began to code through test-driven-development, I almost always code so that I can see both my test file and the code that it is testing. In sublime, this involved using a two column layout. In vim, I accomplished this through split panes. It is important to see the tests and the code at the same time. </p>
<p>tmux lets me keep a command prompt as a pane in the lower 20% of the screen. This is useful in so many ways. I use it most often for running tests. Using the vim add-on <a href="https://github.com/epeli/slimux">slimux</a>, I can easily send commands to any pane or window I want. Telling that pane to run a test generally requires no more than two keystrokes.</p>
<p>An amazing plugin for Sublime that lets you test is RubyTest. <span>However, tmux allows me to do much more than test. It gives me a full terminal to use that I can expand anytime I want. For example, if I edited a User model to include some database migrations, I would need to run rake db:migrate and rake db:test:prepare before running my actual tests. In Sublime, this requires switching to the terminal app and running those commands, and switching back. In vim, I could accomplish this with :! rake….but the resulting output would take up the screen until I pressed enter.</span></p>
<p><span>With tmux, I can do both of these from my text editor without losing focus of my text editor. I am able to see the results of the test and keep typing code.</span></p>
<p>The main advantage of tmux is that I don’t have to leave tmux for routine editing. Of course, my workflow would be different if I was doing front-end work (designing the site, making sure javascript worked, etc). </p>
<p><strong>Windows</strong></p>
<p>Windows are pretty much just tabs. To my knowledge, tmux doesn’t really add anything crazy to it, but they are there. </p>
<p><strong>Persistence</strong></p>
<p>tmux has sessions, and it stores persistence. Unless I restart my computer(which does end the session), when I open tmux again, my session will still remain there. Tmux doesn’t <em>save </em>my session. It keeps running it and by opening tmux again, I am just re-connecting to it. </p>
<p>There are at least two major advantages of this. First, I can quit terminal and come back to my work later without any hesitation. Second, when I return, apps that were running will still be running. I don’t need to restart my rails server. I don’t need to open up my rails console again. </p>
<p><strong>Sessions</strong></p>
<p>You can have as many sessions as you want. For me, this means having different projects as different sessions. This allows me to switch between them (or work on both of them) at once really easily. Persistence, as mentioned above, becomes incredibly more useful when dealing with multiple projects.</p>
<p><strong>Negatives</strong></p>
<p>Copy and paste from the Mac clipboard does require an additional program (reattach-to-user-namespace) and work, but it is manageable and worth it. </p>
<p><strong>Plugins worth mentioning</strong></p>
<p><a href="https://github.com/aziz/tmuxinator">Tmuxinator</a> allows you to set defaults and save those projects. Slimux lets you send commands to specific panes. <a href="https://github.com/jgdavey/vim-turbux">Vim-turbux</a> allows you to send testing commands to panes.</p>
<p><strong>Conclusion</strong></p>
<p>Sorry if any of it came off as confusing; I definitely recommend going through a few of the resources below to get a better understanding of tmux’s power.</p>
<p>I do love working in tmux, but like vim, there is a slight learning curve before becoming really effective with it. Like vim, the preset defaults aren’t terrific.</p>
<p>The above reasons are why tmux works well for me. There are a lot of reasons to switch that I haven’t covered, like working on an <a href="http://bergie.iki.fi/blog/six-weeks-working-android/">android tablet</a> efficiently or using it to <a href="http://pivotallabs.com/how-we-use-tmux-for-remote-pair-programming/">pair program</a>. </p>
<p><strong>Resources</strong></p>
<p>Below are some pretty good resources on experimenting with .tmux and setting it up well. $ indicates a paid resource.</p>
<ul>
<li><span>$ <a href="http://pragprog.com/book/bhtmux/tmux">tmux: Productive Mouse Free Development</a> is probably the best guide on tmux there is. </span></li>
<li><span>$ <a href="https://learn.thoughtbot.com/products/4-humans-present-tmux">Thoughtbot - Humans Present Tmux</a></span></li>
<li><a href="http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course"><span>Thoughtbot - Tmux Crash Course</span></a></li>
<li><span><a href="http://robots.thoughtbot.com/post/19398560514/how-to-copy-and-paste-with-tmux-on-mac-os-x">Thoughtbot - How to Copy and Paste with tmux</a><br /></span></li>
<li><a href="http://www.youtube.com/watch?v=vHdiXoHKSgU"><span>LA Ruby Conf Talk</span></a></li>
<li><span><a href="http://thechangelog.com/episode-0-7-3-tmux-with-brian-hogan-and-josh-clayton/">The Changelog, Tmux with Brian Hogan and Josh Clayton</a></span></li>
<li>Other people’s dotfiles. I wouldn’t recommend <a href="https://github.com/djquan/dotfiles">mine</a>; Josh Clayton is a proficient user and has all <a href="https://github.com/joshuaclayton/dotfiles">his dotfiles up.<br /></a></li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Backbone, round 1]]></title>
<link href="http://djquan.github.io/blog/2013/05/14/backbone-round-1/"/>
<updated>2013-05-14T12:57:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/14/backbone-round-1</id>
<content type="html"><![CDATA[<p>There are a lot of javascript frameworks out there. <a href="http://coding.smashingmagazine.com/2012/07/27/journey-through-the-javascript-mvc-jungle/">This article</a> and <a href="http://todomvc.com/">this site</a> helped to clear up some of my confusion. </p>
<p>I just had my first introduction to these frameworks/libraries with Code School’s Anatomy of Backbone.js, Part I. <span>Like most of their courses, it was a good </span><strong>introduction</strong><span> to the material that convinced me that I need to learn a lot more about it.</span></p>
<p>PeepCode has released a new screencast on troubleshooting; it was pretty informative. They created a graphic on it <a href="https://peepcode.com/blog/2013/seven-troubleshooting-strategies-poster/img/7strategiesposter.pdf">here</a>. </p>
<p>Mackup, as described in the <a href="http://quan.io/post/50178150864/obligatory-first-pull-request-post-for-those-that">previous post</a>, was featured on <a href="http://lifehacker.com/mackup-backs-up-and-syncs-your-application-settings-acr-504512985">lifehacker</a>!</p>
<p><span>Log for 5/12 - 5/14</span></p>
<ul>
<li>PeepCode - Episode 84, Troubleshooting</li>
<li>A few project euler problems</li>
<li>tmux: Productive Mouse Free Development by Brian Hogan</li>
<li>Started Practical Vim by Drew Neil</li>
<li>CodeSchool - Anatomy of Backbone.js, Part I</li>
</ul>
<p></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Pull Request]]></title>
<link href="http://djquan.github.io/blog/2013/05/11/pull-request/"/>
<updated>2013-05-11T16:03:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/11/pull-request</id>
<content type="html"><![CDATA[<p>Obligatory first pull request post! For those that don’t know, a pull request is a way of contributing back to the open source community. You request that the creator/maintainer of a particular piece of software incorporate your code into the overall code to add a feature or fix a bug. </p>
<p>My first pull request was to <a href="https://github.com/lra/mackup">mackup</a>, a program that lets you keep all your dotfiles (specific configuration files for a variety of apps) in sync through Dropbox. This is an entirely easy thing to do without this software through creating symbolic links, but mackup automates this process, cutting down a lot of time and commands. My contribution was adding support for tmuxinator and teamocil dotfiles. It was only about five lines of additional code, but it still feels good to add features onto a piece of software I use regularly. </p>
<p>Once again, I’ll recommend Thoughtbot’s Learn Prime. I’m currently doing their Test Driven Rails course, and it has been pretty informative so far. It’s also pretty nice to learn about testing from one of the contributors to FactoryGirl. With learn prime, you get posting privileges to the new <a href="http://forum.thoughtbot.com/">thoughtbot forums</a>. It’s pretty nice having a a lifeline to the thoughtbot team(including the chat pytel, the ceo, and ben orenstein) on any topic. </p>
<p>If you do any kind of front end text editing, Emmet (formerly zen-coding) is definitely <a href="http://docs.emmet.io/">worth a look.</a> </p>
<p>Log for 5/8 - 5/11</p>
<ul>
<li>Thoughtbot - Test Driven Rails, Writing Integration Tests</li>
<li>Thoughtbot - Humans Present tmux</li>
<li><a href="http://www.youtube.com/watch?v=vHdiXoHKSgU">Ruby Productivity with Vim and Tmux</a> talk</li>
<li>Started jumpstart labs event-manager tutorial (will try this tutorial entirely in vim)</li>
<li>Ruby Rogues - Episode 104, Book Club discussing The Rails View </li>
</ul>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Tapas]]></title>
<link href="http://djquan.github.io/blog/2013/05/07/tapas/"/>
<updated>2013-05-07T16:08:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/07/tapas</id>
<content type="html"><![CDATA[<p><p>Ruby Tapas are short screencasts that cover small topics of the Ruby language. Access to them is $9/month, and the creator (Avdi Grimm) releases three per week. Go to the site and listen to any number of the free ones he provides and you will realize that it is a great bargain. I’m currently working my way through them all and learning a lot. </p>
<p><a href="http://testfirst.org/learn_ruby">Test First Ruby</a> is a pretty interesting way to practice programming. It’s a lot like RubyKoans in the sense that it relies on TDD. There are many chapters with different objects. For example, one chapter has you create a pig-latin converter. Another tasks you to create a Reverse Polish Notion calculator. Some are a lot simpler, like extending the Array class to add a function (of course, whether doing so is a smart idea is another thing). </p>
<p>A goal for the coming week is to check out some front-end resources. I love playing around and programming in Ruby, but it’s not the only thing I need to learn well. </p>
<p>Log for 5/2 - 5/7</p>
<ul><li>Ruby Tapas - #1 - 10</li>
<li>Completed Test First Ruby</li>
</ul></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Efficiency]]></title>
<link href="http://djquan.github.io/blog/2013/05/01/efficiency/"/>
<updated>2013-05-01T16:14:00-04:00</updated>
<id>http://djquan.github.io/blog/2013/05/01/efficiency</id>
<content type="html"><![CDATA[<p><p><span>A major lesson I’ve learned from experimenting with vim is that efficiency does matter, no matter the editor. The tools a person chooses are important, and it’s important to be efficient and precise with them. </span></p>
<p>In vimadventures, they have these levels where you have to accomplish certain editing and navigating texts within a certain number of keystrokes. The goal is to make you think about it now, so that it can be engrained later. </p>
<p>I’m still up in the air about making it my primary editor, but it has changed the way I approach Sublime Text. I’m constantly asking, is there a way I can do <em>x </em>without reaching for the mouse and without pressing too many keys. To rephrase an earlier statement, the tools a person chooses are important, but it’s more important to be efficient and precise with them than choosing the perfect one. </p>
<p>This <a href="https://www.hackerschool.com/manual">manual</a> by hacker school is pretty awesome. The parts on social rules and pair programming are worth a gander.</p>
<p>Toying around with moving the “Curriculum” session <a href="https://trello.com/b/NApK9yRl">to a Trello board</a>. It’s easier to maintain, allows any trello user to comment, and will help me get used to trello.</p>
<p>Log for 4/30 - 5/1</p>
<ul><li>Started Test-First-Ruby</li>
<li><a href="https://tutsplus.com/course/improve-workflow-in-sublime-text-2/">Tuts+ tutorial</a> on setting up a good ST2 workflow</li>
<li>Spent a lot of time trying to get an efficient workflow…went back and forth between vim and ST2 a lot. I’m working on posting <a href="https://trello.com/board/my-setup/5181b0017dca609775002b0d">my current setup </a>with both on trello. </li>
</ul></p>
]]></content>
</entry>
</feed>