Skip to content

Instantly share code, notes, and snippets.

View ybur-yug's full-sized avatar

yburyug ybur-yug

View GitHub Profile
$ 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
 => 0

seriously 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')
require 'digest/sha1'
require 'zlib'
require 'pp'
module Git
OBJECTS = {}
class Object
module Gkv
class Database
attr_accessor :items
def initialize
`git init`
@items = {}
end
def set(key, value)
module Gkv
class Database
attr_accessor :items
def initialize
`git init`
@items = {}
end
def set(key, value)
@ybur-yug
ybur-yug / git_db.rb
Last active August 29, 2015 14:22
git database
class GitDatabase
attr_accessor :items
def initialize
`git init`
@items = {}
end
def save(key, input)
set(key, hash_object(input.to_s))
end
@ybur-yug
ybur-yug / _why_kafka.md
Last active August 29, 2015 14:22
_why

here's a transcription of the "trials" sequence:

TRIALS

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.

@ybur-yug
ybur-yug / thoughts_ecom.md
Last active August 29, 2015 14:22
thoughts

Musings

Initial Thoughts

Fucking Launch

Even if its only facebook/twitter + etsy store postings, FUCKING LAUNCH

Even if the UI is less than stellar (but exists), FUCKING LAUNCH

Even if there are no sponsored/tracking links for purchases, FUCKING LAUNCH

Volt Tasks - Introduction

Getting Started

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

#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",