-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.xml
275 lines (197 loc) · 30.2 KB
/
feed.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
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Cameron Stanley</title>
<description>Creating things and writing about them.</description>
<link>http://cameronstanley.com/</link>
<atom:link href="http://cameronstanley.com/feed.xml" rel="self" type="application/rss+xml" />
<pubDate>Mon, 14 Jan 2019 09:32:54 -0600</pubDate>
<lastBuildDate>Mon, 14 Jan 2019 09:32:54 -0600</lastBuildDate>
<generator>Jekyll v3.2.1</generator>
<item>
<title>Productivity with Pomodoro</title>
<description><p>In this post I’ll share a popular productivity hack that I have greatly benefited from called the Pomodoro technique. I started off using this tool for managing my time more effectively as a software engineer, but I have been able to incorporate it into other areas of my life to increase the number of tasks I’m able to get done in a shorter period of time. It can also be a great way to plan and organize your week, as well as improve your estimations of how long projects will take to complete. It shines exceptionally well when working remotely where communication tasks like email and Slack can be batched in chunks twice per hour and physical disruptions are minimum.</p>
<h1 id="what-is-the-pomodoro-technique">What Is the Pomodoro Technique</h1>
<p>The Pomodoro technique looks something like this: work distraction free on a singular task for 25 minutes, then take a short five minute break. This counts as one Pomodoro. After four Pomodoros are completed, take a longer 20 minute break. Repeat this cycle for as many iterations as you can in the work day. During the breaks, do whatever you like - browse your favorite website, use the restroom, brew some coffee, etc. The key is that when you are working on a task, you are solely focused on completing it and save any interruptions for your planned breaks.</p>
<p>It may seem odd at first to take a five minute break twice per hour, but it’s highly likely you are already wasting significantly more time without realizing it. Breaks punctuate tasks and allow your mind to reset before focusing on something new. By using constraints to your advantage, habitual tasks like checking email or Slack, browsing Reddit, or just getting up and walking around are limited to a fixed set of time.</p>
<p>Traditonally a physical kitchen timer is used to track the 25/5/20 minute intervals, but setting one on your phone or using one of the many popular apps or websites work just as well (I personally recommend <a href="https://tomato-timer.com/">Tomato Timer</a>). If a task is completed before the timer goes off, you can either use the remaining time to start on the next task or improve on your work in some way. This could come in the form of documentation, testing, or just mentally reviewing what was done.</p>
<h1 id="why-does-it-work">Why Does It Work?</h1>
<p>Think about the conditions under which you complete your best work. Chances are it’s when you have few distractions, your tasks are clearly defined, and you have momentum carrying you through difficult problems and procrastination. The Pomodoro technique provides a framework for eliminating these hurdles to accomplish more.</p>
<h2 id="less-distractions">Less Distractions</h2>
<p>When coding, a software engineer performs her best while “in the zone”. This hyperfocused state of furious keyboard pecking and light perspiration produces terrific results, but requires absolute concentration. Being interrupted by responding to a notification or Slack message requires a context switch that consumes time and energy to get into deep focus again. Obviously you can’t ignore urgent situations, but most communication can be batched and addressed at most every 25 minutes.</p>
<h2 id="clearly-defined-tasks">Clearly Defined Tasks</h2>
<p>In order for tasks to be broken down into 25 minute chunks, the task has to be clearly defined with a clear success state. If you have been given a large project that doesn’t have many requirements, a good first Pomodoro is to clarify and research what actually needs to be accomplished. From there, do your best to estimate and divide the work for Pomodoros. You may be off at first, but over time you will be able to be more realistic about what can be accomplished in a single Pomodoro, and eventually scale your estimation skills out to the day and week.</p>
<p>Parkinson’s law that “work expands so as to fill the time available for its completion” explains why the 25 minute work window is so effective. If we give ourselves a day to complete a poorly defined monolithic task, we might finish it tomorrow. However, if you analyze and break a problem into its smallest workable parts, your plan of attack will be much more successful.</p>
<h2 id="momentum">Momentum</h2>
<p>Checking items off a list feels good. If you’re having trouble getting started or feel overwhelmed, completing some low hanging fruit will get your mind moving in the right direction. Progress snowballs quickly with quick wins, and with two tasks being completed an hour, the feeling of forward movement will propel you into action quickly.</p>
<h1 id="conclusion">Conclusion</h1>
<p>If you want to get more done, I highly recommend at least giving the Pomodoro technique a try. For one week, plan the tasks you wish to accomplish each day and iterate through Pomodoros. You will be surprised what you can complete by adding some simple structure to your workflow, breaking down tasks into clearly defined components, and limiting distractions.</p>
</description>
<pubDate>Mon, 14 Jan 2019 00:00:00 -0600</pubDate>
<link>http://cameronstanley.com/2019/01/14/productivity-with-pomodoro.html</link>
<guid isPermaLink="true">http://cameronstanley.com/2019/01/14/productivity-with-pomodoro.html</guid>
<category>productivity</category>
</item>
<item>
<title>Announcing All Green for iOS and Android</title>
<description><p>I recently had some time over the holidays and decided to build a mobile app. At <a href="https://www.fleetio.com/">Fleetio</a>, we use <a href="https://circleci.com/">Circle CI</a> to automatically run our test suites after every commit. I thought it would be useful to be able to monitor the status of my projects on the go, so I set out to create something to solve that problem. As a result, my mobile app All Green is now live in both the <a href="https://itunes.apple.com/us/app/all-green/id1252330663?mt=8">App Store</a> and <a href="https://play.google.com/store/apps/details?id=com.cameronstanley.all_green">Google Play</a>!</p>
<p>All Green is the best way to stay up-to-date on the build statuses of projects being tested through Circle CI. Check failing builds and quickly identify failing tests to keep your projects in the green.</p>
<p>Features:</p>
<ul>
<li>List recent builds for all their projects</li>
<li>View build status and details</li>
<li>Retry failed builds</li>
<li>Cancel currently running builds</li>
</ul>
<hr />
<div class="row">
<div class="col-md-6">
<img src="/assets/all-green-screenshot-1.png" class="img-responsive" />
</div>
<div class="col-md-6">
<img src="/assets/all-green-screenshot-2.png" class="img-responsive" />
</div>
</div>
<hr />
<p>I would greatly appreciate any feedback you on any bugs encountered or features that would improve the app!</p>
</description>
<pubDate>Sat, 13 Jan 2018 00:00:00 -0600</pubDate>
<link>http://cameronstanley.com/2018/01/13/announcing-all-green-for-ios-and-android.html</link>
<guid isPermaLink="true">http://cameronstanley.com/2018/01/13/announcing-all-green-for-ios-and-android.html</guid>
<category>ios</category>
<category>android</category>
<category>ci</category>
</item>
<item>
<title>Go - First Impressions</title>
<description><p>I recently started down the path of learning the Go programming language and wanted to share my experience for anyone interested in becoming a Gopher.</p>
<h1 id="why-go">Why Go?</h1>
<p>Go is typically labeled as a <a href="https://en.wikipedia.org/wiki/System_programming">systems programming</a> language, making it a great tool for building CLIs and backend services that support other applications. It has concurrency baked in with <a href="https://tour.golang.org/concurrency/1">goroutines</a> and is also very fast. The compiler and static typing are welcome features coming from a Java background, making it a scalable language for larger projects. I see Go as another great addition to the programmer’s toolbox, and I would advise anyone interested in growing their skill set to take a look at this great language.</p>
<p><img src="/assets/go-gopher.png" alt="Go gopher" title="Go gopher" class="center-block" /></p>
<h1 id="working-on-a-project">Working on a Project</h1>
<p>I always find the best way to progress in a new language is to pick a non-trivial project and see it through to completion. I’ve been making <a href="https://github.com/cameronstanley/go-reddit">go-reddit</a>, a wrapper for the Reddit API for a few weeks now. I thought it might be cool to make a Reddit CLI for light console browsing, but the API wrappers currently available are a little lacking in functionality. Development has been pretty steady in my off-time, there are just a ton of endpoints to implement and the response objects can be a little tricky to parse. The main challenges have been:</p>
<h2 id="decoding-of-json">Decoding of JSON</h2>
<p>Parsing the JSON responses from the API is handled using the <a href="https://godoc.org/encoding/json">encoding/json package</a>. The json package will decode the body of a response to a struct, provided that struct’s named fields matches the keys in the JSON object (if not you can explicity declare the mapping using the backticks format as shown below). Here’s an example:</p>
<div class="language-go highlighter-rouge"><pre class="highlight"><code><span class="k">var</span><span class="x"> </span><span class="n">trophyListing</span><span class="x"> </span><span class="k">struct</span><span class="x"> </span><span class="p">{</span><span class="x">
</span><span class="n">Kind</span><span class="x"> </span><span class="kt">string</span><span class="x"> </span><span class="s">`json:"kind"`</span><span class="x">
</span><span class="n">Data</span><span class="x"> </span><span class="k">struct</span><span class="x"> </span><span class="p">{</span><span class="x">
</span><span class="n">Trophies</span><span class="x"> </span><span class="p">[]</span><span class="o">*</span><span class="n">Award</span><span class="x"> </span><span class="s">`json:"trophies"`</span><span class="x">
</span><span class="p">}</span><span class="x"> </span><span class="s">`json:"data"`</span><span class="x">
</span><span class="p">}</span><span class="x">
</span><span class="n">err</span><span class="x"> </span><span class="o">=</span><span class="x"> </span><span class="n">json</span><span class="o">.</span><span class="n">NewDecoder</span><span class="p">(</span><span class="n">resp</span><span class="o">.</span><span class="n">Body</span><span class="p">)</span><span class="o">.</span><span class="n">Decode</span><span class="p">(</span><span class="o">&amp;</span><span class="n">trophyListing</span><span class="p">)</span><span class="x">
</span><span class="k">if</span><span class="x"> </span><span class="n">err</span><span class="x"> </span><span class="o">!=</span><span class="x"> </span><span class="no">nil</span><span class="x"> </span><span class="p">{</span><span class="x">
</span><span class="k">return</span><span class="x"> </span><span class="no">nil</span><span class="p">,</span><span class="x"> </span><span class="n">err</span><span class="x">
</span><span class="p">}</span><span class="x">
</span></code></pre>
</div>
<p>Where it starts to get tricky is when you have multiple types that can be returned in a listing, which requires more dynamic parsing. I’m still working through the cleanest way to implement this functionality.</p>
<h2 id="implementing-oauth2">Implementing OAuth2</h2>
<p>The <a href="golang.org/x/oauth2">oauth2 package</a> does a lot of the heavy lifting for implementing OAuth2, but I have still been struggling with a HTTP 429 Too Many Requests error when exchanging the authentication code for an access token according to the protocol:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>oauth2: cannot fetch token: 429 Too Many Requests
</code></pre>
</div>
<p>Reddit requires a unique User-Agent header to be set for all authenticated requests, and will heavily rate limit any calls not providing it. Doing some Googling suggests that is the cause of my HTTP 429 error code, but the oauth2 package does not have the functionality to set the User-Agent during the token exchange. It looks like I’m going to need to implement the token exchange manually, which shouldn’t be too difficult.</p>
<h1 id="initial-thoughts">Initial Thoughts</h1>
<p>In my short amount of time working with Go, I have been impressed with the simple yet powerful syntax. Having a compiler and static type checking took a little bit of getting used to but really increases productivity by catching complation errors. I’m also particularly fond of the <a href="https://golang.org/cmd/gofmt/">gofmt</a> tool that will autocorrect formatting issues leading to more readable and consistent code. The <a href="https://golang.org/pkg/testing/">testing package</a> provides a nice framework to write and run tests and I’m going to try out one of the BDD packages when I have some time. Go feels similar to in spirit to C, but I feel like it is easier to produce fast, working, well tested and documented code using it.</p>
<p>I did run in to some early issues with not having my $GOPATH set correctly, so be sure to follow the <a href="https://golang.org/doc/code.html#GOPATH">install instructions</a>. Also, when working on go-reddit it took me a little while to figure out that if you are going to use your package locally in a <code class="highlighter-rouge">package main</code> program it needs to be located within your $GOPATH to be able to import it. My project was located in directory outside my $GOPATH and it was a bit of a headache trying to debug it.</p>
<p>Overall, I am loving Go and would highly recommend it to anyone looking to add a great language to their skill set.</p>
<h1 id="learning-resources">Learning Resources</h1>
<p>Here’s a list of resources I utilized while learning Go:</p>
<ul>
<li><a href="https://tour.golang.org/list">A Tour of Go</a> is the official tutorial and a great way to get your feet wet with the language. I’d recommend starting here since it has an interactive console you can follow along without having to setup your development environment.</li>
<li><a href="http://codeschool.com">Code School</a> recently launched a new course titled “On Track With Golang” that is a pretty great introduction to the language. Usually their courses are enough to only get the basic syntax of a language down, but I found myself feeling like I had a significant handle on Go once I finished it. If you have an account, definitely spend the time to go through this one.</li>
<li><a href="https://github.com/avelino/awesome-go">awesome-go</a> is a curated list of Go packages that you can use in your projects. It’s always nice to have one of these when exploring a new community to see what is available and to get some quality real-world examples.</li>
<li><a href="https://godoc.org/">GoDoc</a> is the official documentation host for Go packages. Any open-source project on GitHub, GitLab, or Bitbucket has its documentation published here and is in a clean viewable format. It is very useful when importing and using an open-source package in your project.</li>
</ul>
<h1 id="tools">Tools</h1>
<ul>
<li><a href="https://github.com/fatih/vim-go">vim-go</a> is a must-have if you are a vim user (like me). Syntax highlighting, gofmt on save, and being able to jump to a declaration are all invaluable.</li>
<li><a href="https://github.com/golang/lint">golint</a> is a linter for Go and a great way to ensure you are writing stylistically correct and GoDoc ready code.</li>
</ul>
<p><em>Go Gopher created by Renee French and licensed under <a href="https://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attributions 3.0</a>.</em></p>
</description>
<pubDate>Sat, 05 Nov 2016 00:00:00 -0500</pubDate>
<link>http://cameronstanley.com/2016/11/05/go-first-impressions.html</link>
<guid isPermaLink="true">http://cameronstanley.com/2016/11/05/go-first-impressions.html</guid>
<category>go</category>
</item>
<item>
<title>RubyGems Error</title>
<description><p>While trying to get some environment variables setup with Travis CI using the travis gem from the command line I ran in to this error:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>travis encrypt <span class="nv">SPOTIFY_CLIENT_ID</span><span class="o">=</span>&lt;obfuscated&gt;
/Users/Cameron/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:2159:in <span class="sb">`</span>method_missing<span class="s1">': undefined method `this'</span> <span class="k">for</span> <span class="c">#&lt;Gem::Specification:0x3ff7a8d716f0 travis-1.8.2&gt; (NoMethodError)</span>
from /Users/Cameron/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1057:in <span class="sb">`</span>find_active_stub_by_path<span class="s1">'
from /Users/Cameron/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'</span>
from /Users/Cameron/.rvm/gems/ruby-2.3.0/gems/travis-1.8.2/lib/travis/cli.rb:2:in <span class="sb">`</span>&lt;top <span class="o">(</span>required<span class="o">)</span>&gt;<span class="s1">'
from /Users/Cameron/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'</span>
from /Users/Cameron/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in <span class="sb">`</span>rescue <span class="k">in </span>require<span class="s1">'
from /Users/Cameron/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'</span>
from /Users/Cameron/.rvm/gems/ruby-2.3.0/gems/travis-1.8.2/bin/travis:7:in <span class="sb">`</span>&lt;top <span class="o">(</span>required<span class="o">)</span>&gt;<span class="s1">'
from /Users/Cameron/.rvm/gems/ruby-2.3.0/bin/travis:22:in `load'</span>
from /Users/Cameron/.rvm/gems/ruby-2.3.0/bin/travis:22:in <span class="sb">`</span>&lt;main&gt;<span class="s1">'
from /Users/Cameron/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'</span>
from /Users/Cameron/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in <span class="sb">`</span>&lt;main&gt;<span class="s1">'
</span></code></pre>
</div>
<p>After a bit of googling, this got it working:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>gem pristine --all
</code></pre>
</div>
<p>Cheers!</p>
</description>
<pubDate>Tue, 09 Feb 2016 13:30:00 -0600</pubDate>
<link>http://cameronstanley.com/2016/02/09/rubygems-error.html</link>
<guid isPermaLink="true">http://cameronstanley.com/2016/02/09/rubygems-error.html</guid>
<category>ruby</category>
<category>rubygems</category>
</item>
<item>
<title>Using Glyphicons PRO with Rails</title>
<description><p><a href="http://getbootstrap.com">Bootstrap 3</a> comes packaged with a fancy set of over 250 free icons called <a href="http://glyphicons.com/">Glyphicons</a> that can easily be used to make your application more user friendly. After using them for some time, but needing a little more variety in my icon choice, I decided to upgrade to Glyphicons PRO which provides close to 1000 icons in various formats and sizes. It also includes a web font which plays nicely with Rails after a little configuration. Here’s how to get Glyphicons PRO working in your Rails project:</p>
<p><strong>Note: This tutorial assumes a Rails 4 project using Sass.</strong></p>
<p>First, make the web fonts available in the asset pipeline by copying them to app/assets/fonts (create this directory if it doesn’t already exist).</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>mkdir &lt;rails_root&gt;/app/assets/fonts
cp glyphicons_pro/glyphicons/web/html_css/fonts/<span class="k">*</span> &lt;rails_root&gt;/app/assets/fonts/
</code></pre>
</div>
<p>Next, copy the provided glyphicons.css file to app/assets/stylesheets and name it with a .css.scss extension.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>cp glyphicons_pro/glyphicons_all/glyphicons/web/html_css/css/glyphicons.css &lt;rails_root&gt;/app/assets/stylesheets/glyphicons.css.scss
</code></pre>
</div>
<p>Finally, the URL paths for the fonts inside of glyphicons.css.scss need to be modified to use the asset helper <code class="highlighter-rouge">font-url</code>. Remove the <code class="highlighter-rouge">../fonts/</code> portion of the path and wrap the filename in <code class="highlighter-rouge">font-path()</code> for each font file.</p>
<div class="language-css highlighter-rouge"><pre class="highlight"><code><span class="k">@font-face</span> <span class="p">{</span>
<span class="nl">font-family</span><span class="p">:</span><span class="s2">'Glyphicons Regular'</span><span class="p">;</span>
<span class="nl">src</span><span class="p">:</span><span class="sx">url(font-path('glyphicons-regular.eot')</span><span class="p">);</span>
<span class="nl">src</span><span class="p">:</span><span class="sx">url(font-path('glyphicons-regular.eot?#iefix')</span><span class="p">)</span> <span class="n">format</span><span class="p">(</span><span class="s2">'embedded-opentype'</span><span class="p">),</span>
<span class="sx">url(font-path('glyphicons-regular.woff2')</span><span class="p">)</span> <span class="n">format</span><span class="p">(</span><span class="s2">'woff2'</span><span class="p">),</span>
<span class="sx">url(font-path('glyphicons-regular.woff')</span><span class="p">)</span> <span class="n">format</span><span class="p">(</span><span class="s2">'woff'</span><span class="p">),</span>
<span class="sx">url(font-path('glyphicons-regular.ttf')</span><span class="p">)</span> <span class="n">format</span><span class="p">(</span><span class="s2">'truetype'</span><span class="p">),</span>
<span class="sx">url(font-path('glyphicons-regular.svg#glyphiconsregular')</span><span class="p">)</span> <span class="n">format</span><span class="p">(</span><span class="s2">'svg'</span><span class="p">)</span>
<span class="p">}</span>
<span class="o">...</span>
</code></pre>
</div>
<p>Restart your rails server and the icons will now be available in your app.</p>
<p>Note the difference in naming between the CSS class for Bootstrap Glyphicons (<code class="highlighter-rouge">glyphicon</code>) and Glyphicons PRO (<code class="highlighter-rouge">glyphicons</code>). If your project was previously using Bootstrap 3 Glyphicons, each usage will need to be modified to take advantage of Glyphicons PRO.</p>
<div class="language-html highlighter-rouge"><pre class="highlight"><code><span class="nt">&lt;span</span> <span class="na">class=</span><span class="s">"glyphicons glyphicons-thumbs-up"</span><span class="nt">&gt;</span>
</code></pre>
</div>
</description>
<pubDate>Fri, 14 Aug 2015 05:30:00 -0500</pubDate>
<link>http://cameronstanley.com/2015/08/14/using-glyphicons-pro-with-rails.html</link>
<guid isPermaLink="true">http://cameronstanley.com/2015/08/14/using-glyphicons-pro-with-rails.html</guid>
<category>rails</category>
<category>glyphicons</category>
</item>
<item>
<title>First</title>
<description><p>I’m starting this blog to keep up with things I learn or find interesting related to programming and software engineering, with the hopes it will help someone else. I’m currently a senior software engineer at <a href="http://www.temenos.com/en-us/">Temenos</a> working on banking channel products. I’ve primarily worked on projects written in Ruby on Rails, Java, and Objective-C, but lately I have been getting into Node.js, Go, and Swift.</p>
<p>The plan is to churn out at least one entry per week, so be sure to keep an eye out for updates.</p>
</description>
<pubDate>Thu, 28 May 2015 10:15:39 -0500</pubDate>
<link>http://cameronstanley.com/2015/05/28/first.html</link>
<guid isPermaLink="true">http://cameronstanley.com/2015/05/28/first.html</guid>
<category>general</category>
</item>
</channel>
</rss>