pbrisbin dot com
Pacprune
Jun 11, 2011
A fairly long time ago, there was a thread on the Arch forums about clearing your pacman cache.
Pacman’s normal -Sc will remove all versions of any packages that are no longer installed and -Scc will clear that plus old versions of packages that are still installed.
The poster wanted a way to run -Scc but also keep the last 1 or 2 versions back from installed. There was no support for this in pacman directly, so a bit of a bash-off ensued.
Forks and Children
Jun 2, 2011
While writing a small learning exercise in C, I came across a nifty little concept. The task itself was a common one: I wanted to spawn a subprocess to the background while letting the main process continue to loop.
Many thanks go to falconindy who spoon fed me quite a bit as I was wrapping my head around all of this knowledge I’m now shamelessly presenting as my own. In most languages you have some facility to group code into a logical unit (a haskell function or a bash subshell) then pass that unit to a command which forks it off into the background for you (haskell’s forkProcess or bash’s simple &).
Anatomy of a Yesod Application
Apr 29, 2011
subtitle: how to stay sane when developing for the web in haskell
This post was originally about how I structure my Yesod applications and where it differs from the scaffold tool. I’ve since done a bit of a 180 and started to really like the scaffold tool and its structure.
For that reason, I’ve rewritten the post to outline that structure, its benefits and some strategies I use above what it provides to develop and deploy Yesod applications.
Lazy Haskell
Apr 9, 2011
Let’s say that you have a list of values and you needed to check if any of those values satisfied some condition.
This can be solved easily with Haskell’s any function, but let’s say you didn’t have that.
Here’s an alternative method using foldr.
any' :: (a -> Bool) -> [a] -> Bool any' p list = foldr ((||) . p) False list any' (== 'x') ['x','y','z'] -- True any' even [1,3,5,7] -- False To understand how this works, you’ve got to wrap your head around two non-trivial functions for haskell beginners: foldr and ..
Notes
Mar 26, 2011
For me, any sort of general purpose note taking and/or keeping solution needs to meet only a few requirements:
Noting something has to be quick and easy (in a terminal and scriptable) Notes should be available from anywhere… tothecloud! Notes should be searchable Now, just to clarify – I’m not talking about classroom notes, those things go in note-books. I’m talking about short little blurbs of information I would like to keep and reference at a later time.
Landlord Reviews
Mar 25, 2011
Last weekend, when our heat wasn’t working (again), I had an idea: What if there were a site where I could bitch about my landlord? Then, people who were about to sign a lease could check on this site and see if their would-be landlord sucks… before they sign that lease.
After confirming with the girlfriend marketing that this was actually a half-way decent idea, I started to get excited about it. A few short hours later and I had a decent mock-up.
Hackday
Feb 28, 2011
The idea was that 100 developers, 50 designers, and 50 “others” would all get together Friday night, team up and develop a phone or web app to make life better in the city of Boston.
Each team would have until 2:30 Sunday afternoon to get something demo-able. Then they would present and be judged.
The Team 🔗Friday night was a bit of a social mixer with drinks, food, and mingling up until about 7PM. Then, anyone with an idea was asked to come forward and give a 30 second pitch. Those that didn’t could then go stand with the idea they liked best.
Ajax
Jan 29, 2011
I always thought Ajax (and JavaScript for that matter) was some crazy web technology, some new way of programming the web, some big scary thing that would be really difficult to learn or use.
It’s not. It’s actually just a defined, convenient way of using existing tools to accomplish some goal. I won’t say it’s perfect, or the be-all-end-all of web-tech, but it did come in handy for me in one case.
Posts Database
Jan 9, 2011
This post is crazy out of date. If your interested in the updated ways in which I accomplish the same goals on yesod 0.9, feel free to checkout the site’s [source][]. For the longest time since my move to Yesod, I’ve had the listing of posts on this site embedded in its source. This is not only poor practice, but it made it kludgy to add a new post the site. I’d have to write the post, add the Post info to the source file, then recompile my development sources and deploy them to production.
Android Receiver
Dec 11, 2010
Android notifier is a great little app I just recently found on the marketplace. What it does is use your wifi network or a bluetooth connection to send out a broadcast when certain events happen on your phone.
The idea is to have a companion application running on your computer to listen for the event and pass along the message via some notification system: Growl on Windows/Mac and (I think) gnome-dbus on Linux.