teleren/devto huggingface dataset:
Setup todo.txt CLI on OSX with Homebrew and Dropbox
Published: 2018-10-05 19:14:31

---
title: Setup todo.txt CLI on OSX with Homebrew and Dropbox
published: true
tags: 
canonical_url: http://dangerisgo.com/blog/2012/09/20/setup-todo-dot-txt-cli-on-osx-with-homebrew-and-dropbox.html
---

I have recently re-discovered [todo.txt](http://todotxt.com) the handy plain text todo list, along with its CLI. I have fallen in love with this method for keeping to-do lists, it's taggable and has search capabilities too! One of the biggest pain points for me getting started was installing the CLI and hooking it up to Dropbox for cross-platform sharing. The todo.txt docs don't provide much of a step by step getting started for OSX with homebrew, they merely say go install with homebrew and then you have to dig through the Tips and Tricks to find what different params to setup to customize your experience.

This article will walk you through setting up [todo.txt](http://todotxt.com) CLI on OSX with Homebrew and storing your todo.txt files in Dropbox for use across multiple platforms.

Heads up! make sure to change any `<your username>` to your OSX username

1. Install todo.txt CLI with homebrew using this command

    `$ brew install todo-txt`

2. Create a folder in your Dropbox folder called “todo”
3. Create the following files in your new folder in your Dropbox folder
    - todo.txt
    - todo.txt.bak
    - report.txt
    - done.txt   
  

    Or from the command-line, you could `cd` into your new folder and run this command instead

    `$ touch todo.txt todo.txt.bak report.txt done.txt`

4. Make a copy of the todo.cfg in your new Dropbox folder

    `$ cp /usr/local/Cellar/todo-txt/2.9/todo.cfg $HOME/Dropbox/todo`

5. Update your new todo.cfg file to reflect the location of your todo directory. This should be on line 4 change `/Users/gina/Documents/todo` to `$HOME/Dropbox/todo`

6. Update your `~/.bash_profile` with these lines

    `source /usr/local/Cellar/todo-txt/2.9/etc/bash_completion.d/todo_completion
complete -F _todo t`

    `alias t='/usr/local/Cellar/todo-txt/2.9/bin/todo.sh -d $HOME/Dropbox/todo/todo.cfg'`

    This will give you the shortcut of `t` so you don't have to type todo.sh every time. It will also add tab complete to for `t` as well.

7. Restart your terminal and you should now be able to add tasks using

    `$ t add “My first task”`

For more info about todo.txt see [http://todotxt.com](http://todotxt.com)
Flex "Global" RSLs
Tags: flex, global, path, programming
Published: 2018-08-27 20:55:30

---
title: Flex "Global" RSLs
published: true
tags: flex,global,path,programming
canonical_url: https://kritner.blogspot.com/2011/12/flex-global-rsls.html
---

I am looking into deploying our custom libraries in flex in a "Global RSL Library" fashion.  I'm not sure how exactly to describe what we're trying to do but I'm going to give it a shot.  
  
In every example I've found thus far, when using RSLs, the path specified at compilation is either:  
1) Relative to the deployment path of the application (swf)   
2) An absolute path.  
  
Due to our development process and site layout, neither of these above methods of using an RSL is ideal.  What I am hoping to find a solution for, is specifying a relative path for an RSL in relation to the web root.  
  
e.g. if I specify /libs/rsl.swf as my path, when launching my swf located at http://192.168.1.50/someDirectory/someOtherDirectory/project.swf the swf will access the RSL at location http://192.168.1.50/libs/rsl.swf  
  
The problem we are trying to avoid in option 1 is that our swf files are located in varying directories all over our site, and to have duplicate copies of the libraries all over is redundant, and makes updates to our libraries more difficult as we have to make sure to deploy in every path where the RSL exists.  
  
Option 2 (Absolute path) does not work especially well either in that our code is tested and QAd in varying environments (but only compiled once in our dev environment) - so specifying our absolute production RSL URL in addition failover URLs for every environment prior to production has a very high margin for error, and as far as I can tell, compile options are not something that can be reviewed in our QA process (to ensure that the developer [me] put in the correct production RSL path)  
  
Is what am I attempting to accomplish understood?  I cannot be the first person that has wanted to be able to do something like this, have I simply overlooked the solution on the interweb?  
  
- Kritner
Node.js skeleton project
Published: 2017-10-31 19:53:04

---
title: "Node.js skeleton project"
published: true
tags: 
canonical_url: https://michael.mior.ca/blog/node-js-skeleton-project/
---

Unfortunately, it’s obviously been a long time since this blog has been updated. Since the last post, I’ve been hard at work rewriting our Web app in Django (finally got rid of our old PHP) and picking up iPhone app development. Keep an eye out for some cool stuff coming up in the near future.

In my spare time, I’ve been playing around with Node.js development. I decided to release the sample project I’ve been working on. You may find it useful if you’re looking to get up and running quickly. It’s still a work in progress, but it’s coming along nicely.

Check out [node-loco-skeleton](https://github.com/michaelmior/node-loco-skeleton) on GitHub.
Things Most Interviewees Fail to Discover
Published: 2021-02-14 15:59:58

---
title: Things Most Interviewees Fail to Discover
published: true
date: 2012-08-17 16:00:00 UTC
tags: 
canonical_url: https://www.rakeroutes.com/things-most-interviewees-fail-to-discover
---

It’s a great time to be a Rails developer. Companies left and right are turning to Rails or using it already for efficient web development. If you know Rails and the web stack well then you have the luxury of choice: let’s make sure you make a good pick!

# Your future team’s code quality

Your potential coworkers should be writing code that you appreciate. Just as they evaluate your coding skills, you need to evaluate theirs.

If the team doesn’t have any publicly available code: ask for some! While you’re at it ask them for their thoughts on the latest developments in Rails. Do they have opinions on the Am I doing it wrong Rails gist? How about service objects in Rails? TDD? What gems/plugins are they using (e.g. for background processing, profiling)? Are there any test frameworks that you love to work with?

If you are happy after seeing their code and talking with them about programming trends then you have much better odds of being happy with what you find in the company repo.

# Team culture

Surround yourself with coworkers you like. You may think that you don’t need to like your coworkers: but this is a disservice to everyone. There are enough Rails jobs out there that you should be able to find a team that you enjoy. Work is a huge investment of your time so make it a good one.

Is the team a fun, lighthearted atmosphere of silly jokes and Internet memes or a proper and professional environment? It doesn’t matter which, as long it fits you.

# Project management

What does the team do to manage tasks? How does work get assigned? How does code get deployed? You should be comfortable with all of these answers.

# Work in the pipeline

What would you be working on should you join the team? What new projects or features are on the roadmap? If the company has no clear answers: be concerned. No clear direction means thrashing for the development team. If they can’t go into specific details that’s fine, but you should be able to get a general picture.

# Typical days

What is a typical day for a developer at the company like? Is it waking up at 3am because the application is throwing 500 errors (again!)? Is it working long hours because the company already thinks that the dev team is going too slow? Is it come in (or log in), get work done, hang out with coworkers, and go home at a reasonable hour?

# Perks

It goes without saying that you should be happy with the benefits and compensation from the company. But don’t overlook perks!

Does the company send employees (and not just developers) to conferences?

For companies with a lot of remote workers: does it regularly get them all together? Does it get them together in awesome vacation spots?

Does the company provide you with a computer or do you need to bring your own? If the company provides the machine does it belong to you or the company?

# tl;dr

Ask questions!
Test Before > Test After
Tags: tdd, testdrivendevelopment, testing, codequality
Published: 2023-01-24 15:52:09

---
title: Test Before > Test After
published: true
date: 2012-08-03 00:00:00 UTC
tags: tdd, testdrivendevelopment, testing, quality
canonical_url: https://www.rocky.dev/blog/test-before-test-after
---

By now, I hope we can all agree that unit tests are a good idea. I recently gave a presentation on why I think testing before writing production code (TDD) is better than testing after.

## Code Quality

Only writing code to fix failing tests yields:

- Better tests
- Testable code
  - Decoupled
  - Fast
- Less rework
- High test coverage
  - Less debugger
- Simple
  - Less gold-plating

## Continuous Integration

Minimizing time in Red and committing on Green yields:

- Compiling, tested code every ~10 minutes
- Ability to revert to last Green quickly

## Improved Interfaces

Intelligent test names and coding from client's perspective yields

- Self-documenting code with clean, natural interfaces

```csharp
// 👎
GetLog().Debug().Message("My message.");
Log(Priority.Debug, "My message.");
```

```csharp
// 👍
void Debug_LogsDebugMessage() {
   Log.Debug("My message.");
   // Some assert
}
```

Testing after is work, TDD is fun!
Presenting iDeal.NET
Tags: paymentgateway, dotnet, ideal
Published: 2020-11-05 10:25:25

---
title: Presenting iDeal.NET
published: true
date: 2012-06-04 07:00:00 UTC
tags: paymentgateway,dotnet,ideal
canonical_url: 
---

iDeal is the leading online payment platform in the Netherlands. Last year when working on [bidfortickets.nl](http://bidfortickets.nl/) I had to create an API to interact with our iDeal provider (Rabobank) to handle all online payments. I noticed that a lot of examples existed out there especially for PHP, but nothing really usable for the .NET ecosystem. So I decided to open source the API on GitHub and call it [iDeal.NET](https://github.com/robinvanderknaap/iDeal.NET). The API takes care of all communications with the iDeal provider and is easily integrated into a .NET (web)application.

### Supported iDeal versions

iDeal.NET is aimed at iDeal Professional (Rabobank), iDeal Zelfbouw (ABN Amro), iDeal Integrated and iDeal Advanced (ING Bank). These versions allow for real-time feedback on transactions.

iDeal.NET does not yet support iDeal Basic (ING Bank), iDeal Hosted , iDeal Lite (Rabobank) and iDeal Zakelijk which are easily implemented in applications but do not allow for real-time feedback on transactions.

### Source, samples and documentation

The source code is hosted on GitHub, this is where you also find the documentation. The solution includes a sample ASP.NET MVC application which shows the basis usage of iDeal.NET. The sample application uses [www.ideal-simulator.nl](http://www.ideal-simulator.nl/) to simulate the entire process of paying and retrieving status of payments. A live version of the example can be found [here](http://ideal.skaele.it/).

### Usage

Implementation of iDeal is basically about three types of requests: directory requests, transaction requests and status requests. iDeal.NET provides an easy to use API to send the requests and handle the responses.

A directory request for example, which retrieves a list of bank (issuers), is as easy as:

{% gist https://gist.github.com/robinvanderknaap/39588c37d9a170301fb22233cf3b0e2d %}

You can find detailed information about the usage of the API on [GitHub](https://github.com/robinvanderknaap/iDeal.NET)

Enjoy!
SOLID Principles to Code By
Tags: solid, agile, principles, patterns
Published: 2023-01-24 15:03:18

---
title: SOLID Principles to Code By
published: true
date: 2012-05-15 00:00:00 UTC
tags: solid, agile, principles, patterns
canonical_url: https://www.rocky.dev/blog/solid-principles-to-code-by
---

Uncle Bob's book [Agile Software Development, Principles, Patterns, and Practices](https://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445) calls out 5 principles that aid greatly in Test-Driven Development and make programs easier to maintain and extend (definitions complements of [Wikipedia](https://en.wikipedia.org/wiki/SOLID)):

1. Single Responsibility ([SRP](https://en.wikipedia.org/wiki/Single-responsibility_principle)) - Every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.
2. Open-Closed ([OCP](https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle)) - Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
3. Liskov Substitution ([LSP](https://en.wikipedia.org/wiki/Liskov_substitution_principle)) - If S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e., objects of type S may be substituted for objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.).
4. Interface-Segregation ([ISP](https://en.wikipedia.org/wiki/Interface_segregation_principle)) - No client should be forced to depend on methods it does not use.
5. Dependency-Inversion ([DIP](https://en.wikipedia.org/wiki/Dependency_inversion_principle)) - High-level modules should not depend on low-level modules. Both should depend on abstractions. Additionally, abstractions should not depend upon details. Details should depend upon abstractions.
  - No variable should hold reference to concrete class
  - No class should derive from concrete class
  - No method should override an implemented method of any of its base classes

Another that isn't mentioned but that I have found helpful is the Law of Demeter ([LoD](https://en.wikipedia.org/wiki/Law_of_Demeter)) - An object A can call a method of an object B, but A cannot "reach through" B to access another object C to call a method. Otherwise, A implicitly requires greater knowledge of B's internal structure.
Using P4Merge with TortoiseGit
Tags: p4merge, tortoisegit, merge
Published: 2020-11-05 10:27:12

---
title: Using P4Merge with TortoiseGit
published: true
date: 2012-05-13 07:00:00 UTC
tags: p4merge,tortoisegit,merge
canonical_url: 
---

The team I’m currently working with uses [Perforce](http://www.perforce.com/products/perforce) as their versioning system. Personally I prefer Git over Perforce, but Perforce has a great merging/diff tool called [P4Merge](http://www.perforce.com/product/components/perforce_visual_merge_and_diff_tools). Fortunately you can install P4Merge separately without the rest of the system. I mainly use the Bash and TortoiseGit when working with GIT , this article demonstrates how to integrate P4Merge with TortoiseGit.

### Install P4Merge

P4Merge is included in the P4 Installer, when executing the installer you’re are able to install P4Merge only, you have to download the entire installer however. Follow these steps to install P4Merge:

- Go to [http://www.perforce.com/downloads/complete\_list](http://www.perforce.com/downloads/complete_list)
- Click ‘Browse by Platform’ tab
- Chose a platform
- Chose a operating system
- Download P4Merge
- Run the installer and only select P4Merge to install

### Setup Diff Viewer with TortoiseGit

Follow these steps to setup P4Merge as the default diff viewer for TortoiseGit:

- Open TortoiseGit->Settings from the Windows start menu
- Choose ‘Diff Viewer’ from the settings tree
- Choose to use an external tool instead of TortoiseMerge
- Specify the following path and parameters: C:\Program Files\Perforce\P4Merge.exe %base %mine

![](https://cdn-images-1.medium.com/max/708/0*EevNzqzh5PvfQCca.png)

### Setup Merge Tool with TortoiseGit

Follow these steps to set P4Merge as the default merge tool for TortoiseGit:

- Open TortoiseGit->Settings from the Windows start menu
- Choose ‘Merge Tool’ under ‘Diff Viewer’ from the settings tree
- Choose to use an external tool instead of TortoiseMerge
- Specify the following path and parameters: C:\Program Files\Perforce\P4Merge.exe %base %theirs %mine %merged

![](https://cdn-images-1.medium.com/max/710/0*UEGdgw3zMsxDdaYC.png)

### Setup Bash

Integrating P4Merge with GIT from the Bash is explained in [this](http://stackoverflow.com/a/2235841/426840) answer on StackOverflow.
My first ASP.NET application/Masterpage
Tags: applicationpool, apppool, aspnet, iis
Published: 2018-08-27 20:56:02

---
title: My first ASP.NET application/Masterpage
published: true
tags: application pool,appPool,asp.net,iis
canonical_url: https://kritner.blogspot.com/2012/04/my-first-aspnet-applicationmasterpage.html
---

I had been having a few issues when attempting to get asp.net applications working on my web server - not knowing much of anything about asp.net, I was under the assumption it would be similar to the ColdFusion I am used to; it was not.  
  
The thing I didn't understand, which this entry exists to remind me (and potentially any youse out there), is AppPools.  IIS seems to by default assign your web root to an appPool - the default (at least for me) being .NET framework 2.0.  It is as simple as changing the Default website to a new appPool using the 4.0 framework right?  Almost...  
  
Having changed the default appPool to 4.0 framework I was now successfully compiling the standard "Hello World" .aspx - but getting run-time errors when attempting to integrate a master page into my site.  A master-page is a 'template' of sorts that can be used to create similar layout/functionality across numerous sites.  The run-time error was explaining that my MasterPage.master could not be found at ~/MasterPage.master - but it was there!  
  
Luckily my wife Kristen was there (who does know ASP.net) to let me know that if I have my application within a directory in of itself, but the application is set up in a separate directory, then the "~/MasterPage.master" reference is relative to the application, not necessarily the directory that you are working in.  
  
Simple fix?  Create a new application pool on the directory where my code is actually hosted.  Yay! Now everything is working without run time errors!
Writing Clear Code, Not Clever Code
Tags: career, productivity
Published: 2019-07-26 02:02:37

---
title: Writing Clear Code, Not Clever Code
tags: career, productivity
canonical_url: http://mike.sherov.com/clear-code/
published: true
---

In [Practices of an Agile Developer](http://www.amazon.com/gp/product/097451408X), Andy Hunt and Venkat Subramaniam outline a huge list of ways to improve yourself as a software developer. While I found almost every tip in the book to be useful, I found one tip to stand out from the rest, considering it pointed out one of my particularly bad habits: “Write clear code, not clever code”.

One of my passions as a programmer is figuring out new and better ways to do the same thing. I love refactoring code and finding out what was being done in 10 lines, I could do in 3. Or as a better measure, doing something with one if else block instead of a triply nested if else statement. Usually this works out great. The code is simpler to maintain, and less complex for all involved.

However, in my endless pursuit of smaller, clearer code, I would often end up with smaller, more confusing code. In 2009, as a member of a 7 person agile team, it was very easy to measure how I was doing in this category: How often did another team member ask me what a piece of code did? Once I began looking at these problematic blocks of code, I noticed a pattern, and began to work on resolving the problem. It doesn’t matter what my particular problem was… what mattered was that I began looking for it!

**Pay attention to your team members.** Look into why they’re asking you about your code. Maybe there is something you do that makes perfect sense to you, but could be written clearer. **Consider the next person who’s going to be looking at your code.** Chances are, they’ll be happier looking at clearer code, not clever code. You’ll be happier too.
Linux Bash Aliases
Tags: linux, bash, aliases
Published: 2023-01-17 21:43:27

---
title: Linux Bash Aliases
published: true
date: 2012-03-07 00:00:00 UTC
tags: linux, bash, aliases
canonical_url: https://www.rocky.dev/blog/linux-bash-aliases
---

Bash aliases are essentially keyboard shortcuts or abbreviations for longer command sequences. If, for example, we include `alias lm="ls -l | more"` in `~/.bashrc`, typing `lm` gets automatically replaced with `ls -l | more`. Here are some of my aliases and helper functions,

```bash
alias ..='cd ..'
alias ...='cd ../..'
alias install='sudo apt-get install'
# Open aliases for editing and source afterward
alias aliases='sudo gedit $HOME/.bash_aliases && source $HOME/.bash_aliases'

google() {
  search=""
  echo "$1"
  for term in $*; do
    search="$search%20$term"
  done
  xdg-open "http://www.google.com/search?q=$search"
}

extract() {
  if [-f $1] ; then
    case $1 in
      *.tar.bz2) tar xvjf $1;;
      *.tar.gz) tar xvzf $1;;
      *.bz2) bunzip2 $1;;
      *.rar) rar x $1;;
      *.gz) gunzip $1;;
      *.tar) tar xvf $1;;
      *.tbz2) tar xvjf $1;;
      *.tgz) tar xvzf $1;;
      *.zip) unzip $1;;
      *.Z) uncompress $1;;
      *.7z) 7z x $1;;
      *) echo "Don't know how to extract '$1'..." ;;
    esac
  else
    echo "'$1' is not a valid file!"
  fi
}
```
Unit testing Django model mixins
Published: 2017-10-31 19:52:48

---
title: "Unit testing Django model mixins"
published: true
tags: 
canonical_url: https://michael.mior.ca/blog/unit-testing-django-model-mixins/
---

I recently found myself having to unit test some model mixins and I thought I would share the technique I used in case anyone else finds it useful. You could just pick a model which uses the mixin and run the test on instances of that model. But the goal of a mixin is to provide reusable functionality independent of any model. Instead, we create a dummy model we can use for testing.

The model shouldn’t reside in `models.py` since we don’t want it in our database. Instead, we create the model dynamically. However, I wanted to test some functionality which requires saving the model to the database. Fortunately, Django can construct the necessary SQL to create and destroy the database table. We simply override setUp and tearDown to do the heavy lifting.

```
from django.test import TestCase
from django.db import connection
from django.core.management.color import no_style
from django.db.models.base import ModelBase

class ModelMixinTestCase(TestCase):
    """
    Base class for tests of model mixins. To use, subclass and specify
    the mixin class variable. A model using the mixin will be made
    available in self.model.
    """

    def setUp(self):
        # Create a dummy model which extends the mixin
        self.model = ModelBase(' __TestModel__'+self.mixin. __name__ , (self.mixin,),
            { ' __module__': self.mixin. __module__ })

        # Create the schema for our test model
        self._style = no_style()
        sql, _ = connection.creation.sql_create_model(self.model, self._style)

        self._cursor = connection.cursor()
        for statement in sql:
            self._cursor.execute(statement)

    def tearDown(self):
        # Delete the schema for the test model
        sql = connection.creation.sql_destroy_model(self.model, (), self._style)
        for statement in sql:
            self._cursor.execute(statement)
```

To make use of this code, just subclass from `ModelMixinTestCase` and set the mixin class variable to the model mixin class you wish to test. You’ll then have access to a fully functioning model which uses this mixin via `self.model`. Happy testing!