$ irb
2.2.1 :001 > 1.to_f
=> 1.0
2.2.1 :002 > 1.0.to_i
=> 1
2.2.1 :003 > 'i fear weasels'.to_f
=> 0.0
2.2.1 :004 > 'i fear weasels'.to_i
=> 0seriously im blanking so hard on this, check it:
2.2.1 :001 > require 'gkv'
=> true
2.2.1 :002 > db = Gkv::Database.new
=> #<Gkv::Database:0x000000016395d8>
2.2.1 :003 > db.set('test', {key: 'val'})
=> "test"
2.2.1 :004 > db.get('test')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'digest/sha1' | |
| require 'zlib' | |
| require 'pp' | |
| module Git | |
| OBJECTS = {} | |
| class Object | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Gkv | |
| class Database | |
| attr_accessor :items | |
| def initialize | |
| `git init` | |
| @items = {} | |
| end | |
| def set(key, value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Gkv | |
| class Database | |
| attr_accessor :items | |
| def initialize | |
| `git init` | |
| @items = {} | |
| end | |
| def set(key, value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GitDatabase | |
| attr_accessor :items | |
| def initialize | |
| `git init` | |
| @items = {} | |
| end | |
| def save(key, input) | |
| set(key, hash_object(input.to_s)) | |
| end |
here's a transcription of the "trials" sequence:
TRIALS Once a year, I take a month & I read everything I can by one author. This year I read 4 books by Thomas Bernhard in one month. And the year before that, it was everything by Denton Welch in one month. But - in 2009 - see, this was very very dangerous - I read everything by Franz Kafka in one month. I started with "Amerika." It was August. I read The Castle.
First, let's get a basic application set up. I will assume you've already dug around a simple project, but if you are completely new to Volt I would recommend reading through the documentation here. We create a project with a simple
volt new project_name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #devbox % curl "https://quiet-temple-1623.herokuapp.com/frontpage/2" | |
| { | |
| "results": [{ | |
| "title": "Onyx: Distributed Computing in Clojure", | |
| "link": "http://onyx-platform.github.io/", | |
| "submitter": "/u/terretta", | |
| "submission_dt": "2015-05-07 17:28:56 -0500" | |
| }, { | |
| "title": "imgix - Racking Mac Pros on Exposure", | |
| "link": "http://photos.imgix.com/racking-mac-pros", |