Welcome
Read more About Me and contact me at wsmoak@gmail.com.
Tags
Jekyll::Drops::SiteDrop
Posts
-
Digest #2349
Interesting things from Week 49 - December 4, 2023 to December 10, 2023
read more... -
Digest #2348
Interesting things from Week 47 - November 27, 2023 to December 3, 2023
read more... -
Digest #2347
Interesting things from Week 47 - November 20, 2023 to November 26, 2023
read more... -
Modeling the Story
I’m using Ellie.ai to model my domain for a Data Vault project. They have some excellent blog posts on how to get started. Here are a couple of them:
read more... -
Digest #2346
Interesting things from Week 46 - November 13, 2023 to November 19, 2023
read more... -
The Personal Data Vault Begins
Ever since I learned about the Data Vault 2.0 methodology earlier this year, I’ve been thinking about implementing it for myself as a learning project.
read more... -
Digest #2345
Interesting things from Week 45 - November 6, 2023 to November 12, 2023
read more... -
Ruby Extensions in VS Code
Back when I switched to VS Code I followed some advice and installed the Ruby extension by Peng Lv.
read more... -
Using Stripe JS with Chargify
Stripe offers a JavaScript library called Stripe JS that you can use to collect payment details. It sends the customer’s credit card data directly to Stripe and gives you a token so that you don’t have to handle card data on your own server. Let’s see how to integrate this with Chargify subscription signups and card updates.
read more... -
One-Time Pad with GenStage
Ever since I read the blog post and heard José talk about GenStage I’ve wanted to try it out. Lacking an actual need for it however, I had to wait for one to appear. Finally in 2016’s Advent of Code Day 14: One-Time Pad, I found a candidate problem. Let’s see how to use GenStage to solve it.
read more... -
Using Stripe Checkout with Chargify
Stripe offers a JavaScript widget called Stripe Checkout that you can use to collect payment details. It sends the card data directly to Stripe and gives you a token so that you don’t have to handle card data on your own server. Let’s see how to integrate this with Chargify subscription signups and card updates.
read more... -
Building and Using a Custom Nerves System
Nerves provides a way to combine your Elixir project code with everything else that’s needed to build firmware for embedded devices. Let’s see how to customize one of the provided systems and use it in a firmware build.
read more... -
Cat Feeder: Nerves and Persistent Storage
The cat feeder has had a couple of updates recently. First, it’s back to being built with Nerves, because who can come back from ElixirConf and not want to play with Nerves again? Second, it now uses a library called Persistent Storage to keep track of interesting bits of information that I don’t want to lose between software updates. Let’s see how to use Nerves and Persistent Storage together.
read more... -
Cat Feeder: from Polling to Interrupts
One of the long-standing TODOs for the cat feeder has been to switch from polling the proximity sensor to having it send an interrupt. The VCNL4010 chip has an interrupt feature, but I needed to learn a few things before I could use it.
read more... -
Ruby Gem Development with IRB
This weekend I decided to work on a utility to… well, we’ll get back to the original purpose in the next post.
read more... -
Pre-Payments with Chargify and Stripe
Chargify offers flexible pricing schemes for recurring billing including add-ons and metered usage. One thing it doesn’t do out of the box, however, is handle pre-payments. If you’re already using the Chargify API, it’s easy enough to also use your payment gateway’s API to make this happen. Let’s see how to do pre-payments with Stripe and Chargify.
read more... -
Using Braintree JS with Chargify
Braintree offers a JavaScript Drop-In UI that you can include in your signup form to collect payment details and tokenize them so that you don’t have to handle card data on your own server. Let’s see how to integrate this with Chargify.
read more... -
Cat Feeder Fabrication
Now that all the parts have arrived it’s time to try again with fabrication for the cat feeder. The software for this project was MUCH easier than figuring out which parts I needed and how to fit them together! After much measuring and cutting, (good thing I bought extra PVC pipe,) here is what we came up with:
read more... -
Seeding the Database from a CSV file in Phoenix
When you generate a Phoenix project, there is a
read more...priv/repo/seeds.exs
file that you can use to seed the database. Let’s see how to seed it from a CSV file. -
Turning a Stepper Motor with Elixir
While the software for spinning a servo based on a reading from the proximity sensor was working great, unfortunately the servo motor turned out to be under-powered for the job at hand. I had combined parts from two different projects without a sufficient appreciation for the physics involved. I decided to switch to a more powerful stepper motor, so let’s see how to make that turn with Elixir.
read more... -
Accepting PayPal with Chargify Direct
When Chargify originally announced support for customers to pay with PayPal, it was limited to the Chargify-hosted Public Signup and Self-Service pages. If you are using Braintree Blue as your gateway, you can check a box, and your customers will have the option to either pay with a credit card or with PayPal. Recently, the ability to accept PayPal with Chargify Direct was added. Let’s see how it works.
read more... -
Embedded Elixir with Nerves and Bake
Now that the code and the hardware for the automated cat feeder are coming together, let’s see what it takes to build reproducible releases for installation on the Raspberry Pi.
read more... -
Blinking LEDs and Spinning Servos with Elixir
I’ve been looking for an automated cat feeder, and haven’t been very happy with the options. I need it to dispense a very small amount, and only when the cat is present, to avoid it piling up and letting her eat too much at once. (Bad things happen then.) The closest thing I found was the Wireless Whiskers feeder, but I just wasn’t inspired to spend $150 and then fuss with programming it on a tiny screen. And then @bitsandhops posted this:
read more... -
Connect Four in Elixir (Part 3)
In Part 2 of Connect Four in Elixir we updated the board for the players’ moves. Now let’s see how to prevent errors like the same player moving twice in a row, or attempting to move in a column that is full. After that, we’ll consider how to detect a win.
read more... -
Connect Four in Elixir (Part 2)
In Part 1 of Connect Four in Elixir we looked at setting up the project and printing out the 7-by-6 board grid. Now let’s look at handling the players’ moves and updating the game state.
read more... -
Connect Four in Elixir (Part 1)
After watching the Erlang Solutions webinar on game logic in Elixir with Torben Hoffmann and looking through the Acquirex code, I thought I would try something similar. Let’s take a look at the Connect Four game, which involves dropping colored pieces into the top of a 7-column, 6-row vertically suspended grid, and see how it might be done in Elixir.
read more... -
Presenting Source Code with Reveal JS
In “Instantly Better Presentations” Damian Conway shows a great way to step through a block of code by highlighting the exact bit you want the audience to focus on at each moment. You can see him describe it at starting at 1:14:58 of this talk. Now let’s learn how to do it with reveal.js.
read more... -
Building Elixir From Source
With Elixir 1.1.0-beta I made the switch from whatever version of Elixir was available in Homebrew, to bleeding edge compiled from source. It was surprisingly easy!
read more... -
Executable Elixir in Tufte Handout PDFs
Recently I asked the Internet to tell me what the state of the art is these days for plain text to PDF. Pandoc and ASCIIDoctor and Kramdown they said.
read more... -
Phoenix and Ecto with MongoDB
I saw (on @ElixirStatus) that the Ecto adapter for MongoDB was released, and wanted to try it out. Looking around, I found that while the adapter itself was in the hex repository, the PR that would let the Phoenix installer (the phoenix.new mix task) know about mongodb had not yet been merged. Let’s see how to try out someone else’s as-yet-unmerged changes!
read more... -
Phoenix on the Bleeding Edge
As the Phoenix Framework nears a 1.0 release, more and more people are going to want to contribute. That means being able to test changes against the latest code on the master branch. There’s no sense reporting a bug if it’s already been fixed! Let’s find out how to do it.
read more... -
Connecting Phoenix to Fitbit with OAuth2 (Part 2)
In Connecting Phoenix to Fitbit with OAuth2 (Part 1), we stopped with the user about to click “Allow” to give us access to their Fitbit data. In this part, we’ll learn how to handle the redirect from Fitbit, store the OAuth token in the database, and use the token to ask the Fitbit API for the user’s data.
read more... -
Phoenix and the Trailing Format Plug
Many frameworks use the
read more...Accept
header to determine what type of content to send. For API’s you’re often expected to set a header such asAccept:application/json
to indicate that you want a response in JSON format. But what if you’re re-writing an API where clients expect to specify the format as an ‘extension’ such as http://example.com/api/tasks/1.json ? -
Links For Week 31/2015
Links For Week 31/2015
read more... -
Adding Fields to an Ecto Model in Phoenix
I recently needed to add some fields to an Ecto model that I had generated with
read more...mix phoenix.gen.html [...]
, and to use the new fields in a Phoenix app. Google did not immediately serve up a simple tutorial, so here it is! -
Re-Ordering Components on Chargify Hosted Signup Pages
Chargify offers hosted Public Signup Pages so that you don’t have to worry about handling credit card data when your customers sign up for your product or service. If you use Components as part of your pricing model, you may have noticed that they always appear in alphabetical order, and that there is no option to re-order them. If you need to display them in a different order, it’s not hard to do with a little Custom JavaScript (JQuery).
read more... -
Connecting Phoenix to Fitbit with OAuth2 (Part 1)
Now that we’ve learned to create a Phoenix app, add a Users model, and deploy it all to Heroku, it’s time to add authentication. In this example we’ll learn how to hook our Phoenix app up to Fitbit with OAuth2.
read more... -
Joining CSV Files
Have you ever needed to combine data from two csv (comma-separated value) files? Maybe you have transaction data in one, so you know who made payments, and shipping addresses in the other?
read more... -
Phoenix and Ecto: From `mix new` to Heroku
In Deploying a Phoenix app to Heroku we looked at the absolute minimum necessary to get the Hello Phoenix app running on Heroku. This involved modifying config files and adding some environment variables.
read more... -
Deploying a Phoenix app to Heroku
Having (finally) gotten the Phoenix Framework for Elixir installed (/me stares accusingly at Norton Firewall) and played with the Hello Phoenix app a bit locally, I decided to deploy it to Heroku.
read more... -
Bulk Billing Time Change with Chargify
Chargify has a Bulk Billing Date Change feature that allows you to select multiple subscriptions and then change all of them to a certain billing date and time at once.
read more... -
Ruby Project Structure
The team I work with is hiring and I thought I’d attempt the code challenge they’re using for candidates.
read more... -
Same Date Annual Billing with Chargify
Chargify offers flexible pricing structures for recurring billing. For many things, the built-in configuration will work just fine. Sometimes, though, you’ll need to do a bit of work outside the Admin UI to adapt to your situation.
read more... -
OpenMRS Getting Started Documentation Review
read more...Patching "How To Contribute" docs for open source projects as a service. Seriously, ping me if you want to work on one and don't see how.
— Wendy Smoak (@wsmoak) November 30, 2014 -
Listing Stripe Customers in Python
The Stripe API docs are awesome. All the attributes and arguments are explained in the middle column, and you can copy and paste from working examples in several languages in the right-hand column. Sometimes, though, the example code doesn’t do exactly what you need, and the description doesn’t have quite enough information.
read more... -
Fun with mongoDB and GeoJSON
One morning someone asked for help on #mongodb…
read more... -
A Small Fix for Growstuff
Yesterday on Growstuff I noticed that the ‘New garden’ page would let you create a garden with a negative number for the area. That’s not right!
read more... -
Validating Stripe Coupon Codes
Today’s Stripe how-to is on validating coupon codes entered by the customer.
read more... -
How a Data Model Emerges
In Designing the Data I talked about getting frustrated with Rails and Active Record because it required me to figure out too much about the data model before I could start writing the application.
read more... -
Designing the Data
Designing the Data, or, Why I Ditched Rails (for now).
read more... -
Recommended Reading
Recommended reading (and watching) for this week:
read more... -
Appending Data in mongoDB
There is some documentation on updating mongoDB documents on the mongo gem page, and a little more on the wiki Tutorial page.
read more... -
SICP in Clojure
Working through SICP seems to be a popular thing for developers. I was exposed to it briefly in school, but but didn’t finish it. I’ve picked it up occasionally since then, but never made much progress.
read more... -
Java 8 on OS X
This morning I decided to upgrade to the Macbook to the latest and greatest Java version from Oracle.
read more...