Skip to content

Instantly share code, notes, and snippets.

View hausdorff's full-sized avatar
🔜
Soon.

Alex Clemmer hausdorff

🔜
Soon.
View GitHub Profile
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"Description": "Admin username used when provisioning virtual machines"
}
},
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7LbnHC7I0qHlaKx8QP6/ERYMN0L6iI2/OkM3np9053KTor3kKFRAHOcrdyyCqpchjDdj5mph488gAYZnDqz1o7+vWjQm9kEpIe8JXZXkX+uWjyqnQI7eQZzITVLvDrxJ8s7wydYqDqyNeVcPTq4GueukOnrEybd7uKRd9s+IOQz+TqzlItVSBJAAlLGB+szjir9yZz+I/5wZd8tWUYVE0rZGu3mM5kjs8UBQe8oeTS1xBW7vDIVhRnRX0z8QRE6Qp1nxk3euNYDsU+Nu02NqkK3l5Z9qIX93nJWeGH2lZBRE8PrPi8MRz3ZIe2t04Qoe2i+9smc4f5hYlpOW/wOcv clemmer.alexander@gmail.com
This page is not ready for prime time. It is a placeholder and "drop box" for snippets I wish to share with others mad enough to want them. The subject is a Curry Machine which is my take on an alternate reality in which Alan Turing did not develop his eponymous machine, but rather based his argument about computation and universal machines more directly on Haskell Curry's combinatorial logic (OK, Schoenfinkel's). Don't look at me that way. The basic idea was not my own, but grew out of the sort of geek-drunken-brawl that can happen on some mailing lists. More details can be gleaned from red_bean_curry.txt, a mildly edited version of an email thread from when I took this example implementation to another mailing list.
In brief, the file curry.c [AN: source link here, it's a C implementation that's about 1200 lines] implements a simulation of a proposed physical manifestation of the machine, using glass and steel balls to represent bits, two bits per token. Aside from reading these two files, you are on your

Pagination

Since we might end up with quite a long list of todos, it would make sense for us to institute some sort of pagniation system that will allow us to only display X amount, and query the rest. Volt makes this quite friendly. First things first, this will be the first thing we need to add a component for. To do this, we open up our Gemfile

editor Gemfile

and we add the line

Your First App

Volt applications are built with nested components. Out of the box you get one component named main, and can easily include and package others.

volt console

Now, we have our default console. If we check what's up, we will see we are accessing Volt::Page. If we call page.attributes we can see we get a hash back that is something like {:name-><Volt::Model::some_id nil>}. So by default, we are manipulating a page.

Getting Started

I will treat this tutorial as a system for someone with 0 configuration coming in. So we will cover 'basic' things such as managing Ruby versions, using bundler, and generally configuring an environment for development.

Lets Get Ruby

First step to making a Ruby app is to install Ruby. I will primarily cover Linux and OSX options here, but for Windows users, just ensure you install Ruby 2.2.0. We will worry about Ruby versions for that platform later. For managing Ruby on Linux and OSX, I prefer rbenv.

Why Volt?

Note: This is a rough retelling of @ryanstout's talk at Rubyconf.

Web Development has hit a trend that has shown it's head in the past. This pattern, like many others, is a possible indication that history oft repeats itself.

Back in the early Rails days, we basically just rendered HTML. This previously was done by a large amount of patch work, and led to a bunch of bad patterns and things glued together.

Rails took the previous ten years of doing this and found an abstraction for it. It did this using an MVC model.

Moving into the years ahead, Gmail came around, and AJAX became a buzzwork. Asynchronous

Alda

A music programming language for musicians

Inspired by other music/audio programming languages such as [PPMCK][ppmck], [LilyPond][lilypond] and [ChucK][chuck], Alda aims to be a powerful and flexible programming language for the musician who wants to easily compose and generate music on the fly, using naught but a text editor. Alda is designed in a way that equally favors aesthetics, flexibility and ease of use, with (eventual) support for the text-based creation of all manner

class MessageDispatcher
def initialize
@observers = []
end
def register(observer)
@observers << observer
end
def dispatch(message)

Disrupting Ruby Naming

In the source files below, 'slash' means it is in a subdirectory. subdirectories are not allowed in gists. Find the source here [AN: redacted!].

Let's say you, a native Spanish speaker, wanted to write some code and use a library, but you wanted it to be equally functional to a library that already exists, but have Spanish names. So far, our community has been focused on and expecting that everybody learn English. This is enforced in several places, but primarily in our programming languages. Let us be code librarians and ask ourselves: shouldn't we change that?

C

At first, I terrorized C's standard library by replacing the function names with those readable in Spanish. It was a good time.