Quantcast
Channel: pbrisbin dot com
Browsing latest articles
Browse All 165 View Live

The Github Effect

Recently I’ve come across a stretch of similarly themed articles. Articles discussing the increasing shift of all business to be tech-based. The conclusion for business owners is often the same: hire...

View Article



Maybe Is Just Awesome

In Haskell, functions must always return the same consistent type. There is also no concept of nil or null built into the language. This is not meant to handicap you, and the expressiveness and...

View Article

Anonymous Classes In Ruby

Often times, I find myself wanting something anonymous. This occurs quite frequently in code when you need to define, pass or call some functionality which is usually very short and only useful in this...

View Article

Dont Do That

I use Arch linux for a number of reasons. Mainly, it’s transparent and doesn’t hold your hand. You’re given simple, powerful tools and along with that comes the ability to shoot yourself in the foot....

View Article

Escalate Your Scripts

Anyone who knows me knows I love the shell. I got my “start” in bash and still have a plethora of scripts lying around doing all sorts of useful and fun things for me. Recently, however, I tackled a...

View Article


Beware Never Expectations

Mocha expectations are incredibly useful for ruby unit testing. You can stub out all kinds of functionality you depend on, specify exactly what values those dependencies return, and validate that the...

View Article

Git Submodule Config

Git submodules are pretty great. They allow you to have nested git repositories so that modular parts of your app can exist as separate repos but be worked with as one file tree. Another benefit is...

View Article

Image may be NSFW.
Clik here to view.

Dzen

Here’s for a small change of pace…I’d like to talk about a tool I’ve all but forgotten I’m even using (and that’s a compliment to its stability and unobtrusiveness).dzen is a great little application...

View Article


Maybe In Ruby

Sometimes it’s fun to do something completely useless.Recently, I wrote a post about how awesome the Maybe type is in Haskell. In the post, I talked about Functors and Monads and how Maybe can help us...

View Article


Yesod Deployments with Keter

Keter is Michael Snoyman’s answer to the Yesod deployment “problem”. This is something I’ve been looking for a good solution to for some time now and keter does a really great job.Keter is meant to run...

View Article

Console TDD with String IO

If you write console based applications in ruby, chances are you’re going to want to get some test coverage on that eventually. StringIO is a great class to use when you want to assert that your...

View Article

Image may be NSFW.
Clik here to view.

Raury

tl;dr: it’s just like aurget but more stable and fasterDeveloping aurget was getting cumbersome. Whenever something went wrong, it was very difficult to track down or figure out. The lack of standard...

View Article

Vagrant

Despite the enormous increase in popularity lately, it seems some people still don’t know about this project or how it can improve your development work-flow.So, what is it and why should you...

View Article


Be Assertive with Sane Exception Handling

I’m a big fan of Avdi Grimm’s thoughts about writing confident ruby. I think it’s important to not clutter things with a bunch of nil-checks or exception handling. When you’re focused in at the method...

View Article

Sharpening Your Tools

Regardless of what editor you choose or how deeply you decide to extend or configure it, the most important thing for a professional programmer regarding his tool set is awareness.You need to be...

View Article


Deploying Yesod Apps On Heroku

Update This post describes compiling a Yesod application locally using a VM to achieve the compilation on a Heroku-like machine, then pushing the binary up to Heroku to be run. This is an annoying...

View Article

Fake S3

Fake S3 is a gem designed to run a small server on localhost that will correctly handle AWS/S3 GETs and PUTs (among others) while using the local filesystem as the storage backend. This has a number of...

View Article


Extension by Module

Ruby’s open classes are great for adding behavior to existing objects. Though it’s a language feature, there to be used, I’d argue that the majority of times it is used, Open classes weren’t the most...

View Article

Image may be NSFW.
Clik here to view.

Developing Web Applications with Yesod

The following was written for issue 7 of Web & PHP magazine. Please, if you enjoy this article (or my articles in general), take the two minutes to register there and download the full PDF to show...

View Article

Dvd2iso

My latest bash-to-ruby rewrite was dvdcopy to dvd2iso. I changed the name both to disambiguate, and because my primary use case was no longer to duplicate disc to disc, but to just generate the ISO....

View Article

Easy Change

for each desired change, make the change easy (warning: this may be hard), then make the easy change— Kent Beck, September 25, 2012Here’s some code from our main application helper. It provides a small...

View Article


Git-SVN

If you work on a project that’s been around for a while, chances are it might still be using SVN for version control. Even if you can’t get buy-in from Management or Ops to move to Git, you can still...

View Article


Image may be NSFW.
Clik here to view.

Systemd-User

BIG FAT WARNINGOne thing to note, and the reason why I’m no longer using this setup: screen sessions started from within X cannot survive X restarts. If you don’t know what that means, don’t worry...

View Article

Testing POROs In Rails

A lot of smarter people than I have come up with the idea that moving your business logic out of framework based classes and into Plain Old Ruby Objects (POROs) is a Good Thing.Being less tied to your...

View Article

Hard Mode

Recently, while watching Corey Haines and Aaron Patterson pair-program, I heard Mr. Haines mention vim’s “hard mode”. Apparently, this is when you disable the motion commands h, j, k, and l.It’s absurd...

View Article


Chruby

Once I start my new job at thoughtbot, I’ll be working on a variety of ruby and rails projects at the same time. This, combined with the current 2.0 transition, means I once again need a ruby version...

View Article

Image may be NSFW.
Clik here to view.

Chromebook

I’ve heard rumors that a Google Chromebook can make a surprisingly sweet machine for a developer. As someone that works exclusively in the console, it’s easy enough to SSH into a server to do the...

View Article

Image may be NSFW.
Clik here to view.

Aurget v4

Aurget was one of the first programs I ever wrote. It’s seen decent adoption as far as AUR helpers go and it’s gradually increased its feature set over the past number of years.The codebase had gotten...

View Article

Disable All The Caps

If you’re like me and absolutely abhor the Caps Lock key, you’ve probably figured out some way to replace it with a more suitable function. I myself have settled on the following command to make it a...

View Article



Faster Mail

I hear and see a lot of passing complaints about dealing with a large amount of mail. I myself subscribe to a few mailing lists which get quite a bit of traffic and these are usually the first to be...

View Article

For the Library Authors

Recently, Yesod released version 1.2. You can read the announcement here, the changelog here, and a detailed blog post about the subsite rewrite here. These resources do a great job of getting users’...

View Article

Parsing DATABASE_URL

A while back, I made a post about deploying yesod apps to heroku. The method used back then is no longer required (thank God!) and deploying to heroku is super simple these days. So simple, in fact,...

View Article

Cloud Music: A Comparison

For the longest time, my interaction with music was via MPD. I had a substantial collection playing on my always-on desktop. I could connect from anywhere to control the playlist and pick up the stream...

View Article


The Advent of IO

What if we wanted to write a Haskell program to behave something like this:$ runhaskell hello.hs Hello who? $ runhaskell hello.hs Pat Hello Pat $ runhaskell hello.hs -u Pat Hello PATOne implementation...

View Article

Email Encryption

The recent hullabaloo with Snowden and the NSA is very scary. I agree with most Americans that The Government is doing some pretty evil things these days. That said, I also believe that we as cloud...

View Article

Mocking Bash

Have you ever wanted to mock a program on your system so you could write fast and reliable tests around a shell script which calls it? Yeah, I didn’t think so.Well I did, so here’s how I did...

View Article


On Staticness

For almost 7 years, now I’ve had a desktop at home, running, serving (among many things) my personal blog. Doing so is how I learned much of what I now know about programming and system administration....

View Article


Image may be NSFW.
Clik here to view.

Using Notify-OSD for XMonad Notifications

In my continuing efforts to strip my computing experience of any non-essential parts, I’ve decided to ditch my statusbars. My desktop is now solely a grid of tiled terminals (and a browser). It’s quite...

View Article

Automated Unit Testing in Haskell

Hspec is a BDD library for writing Rspec-style tests in Haskell. In this post, I’m going to describe setting up a Haskell project using this test framework. What we’ll end up with is a series of tests...

View Article

Random Numbers without Mutation

In lecture 5A of Structure & Interpretation of Computer Programs, Gerald Sussman introduces the idea of assignments, side effects and state. Before that, they had been working entirely in purely...

View Article

Writing JSON APIs with Yesod

Lately at work, I’ve been fortunate enough to work on a JSON API which I was given the freedom to write in Yesod. I was a bit hesitant at first since my only Yesod experience has been richer html-based...

View Article


Applicative Functors

Every time I read Learn You a Haskell, I get something new out of it. This most recent time through, I think I’ve finally gained some insight into the Applicative type class.I’ve been writing Haskell...

View Article

Regular Expression Evaluation via Finite Automata

What follows is a literate haskell file runnable via ghci. The raw source for this page can be found here.While reading Understanding Computation again last night, I was going back through the chapter...

View Article


Image may be NSFW.
Clik here to view.

tee-io Lessons Learned

A while back, I launched a side project called tee-io. It’s sort of like a live pastebin. You use its API to create a command and then send it buffered output, usually a line at a time. Creating the...

View Article

Deleting Git Tags with Style

Deleting Git tags that have already been pushed to your remote is something I have to google literally every time I do it; why the invocation is so arcane, I don’t know. Finally, I decided to automate...

View Article


Selecting URLs via Keyboard in XTerm

In a recent effort to keep my latest laptop more standard and less customized, I’ve been experimenting with XTerm over my usual choice of rxvt-unicode. XTerm is installed with the xorg group, expected...

View Article

Image may be NSFW.
Clik here to view.

Haskell Project Checklist

The following are all the things I want in place for a Haskell project. This is primarily a copy-paste-able reference for myself, but I’ve also tried to explain or generalize some things to make it...

View Article

GoogleEmail2 Deprecation

I maintain an Auth plugin for authenticating with Google OAuth2 in a Yesod application. This plugin has always had functionality overlap with the GoogleEmail2 plugin in the yesod-auth package. Our...

View Article

Image may be NSFW.
Clik here to view.

Caching Docker Layers on CI

For as long as I’ve built Docker images on CI, I’ve fought the layer caching problem. Working on Haskell projects of many dependencies, an un-cached multi-stage build can take close to an hour. That’s...

View Article


Image may be NSFW.
Clik here to view.

An Opinionated Guide to Options Parsing in Shell

Some may say that you shouldn’t write shell beyond a certain, very low bar of complexity. If you reach for arrays, certainly associative arrays (gasp!), or if your script approaches 20, 50, or 100 (how...

View Article

Browsing latest articles
Browse All 165 View Live




Latest Images