Skip to content

Instantly share code, notes, and snippets.

View ybur-yug's full-sized avatar

yburyug ybur-yug

View GitHub Profile
@ybur-yug
ybur-yug / idonteven.rb
Last active August 29, 2015 14:19
floats? wat?
0 == 0.0000000000000000000000000000000000000000000000000000000000001
# => false
0 == 0.00000000000000000000000000000000000000000000000000000000000001
# => true
0.00000000000000000000000000000000000000000000000000000000000001.to_s.count("0")
# => 2
0.00000000000000000000000000000000000000000000000000000000000001.to_s
# => "0.0"
0.0000000000000000000000000000000000000000000000000000000000001.to_s
# => "1.0e-61"
@ybur-yug
ybur-yug / crackle_pop.rb
Last active August 29, 2015 14:19
CracklePop
NUMS = (1..100).to_a
module CracklePop
class Crackler
def initialize nums
crackle_pop nums
end
def check_num num
if num % 3 == 0 && num % 5 == 0
'CracklePop'
@ybur-yug
ybur-yug / benchmarks.md
Last active August 29, 2015 14:19
Elixir V Node V Sinatra

Benchmarks

The basic example uses only a single route at /hello_world and return Hello world. These benchmarks are extremely simple and should not be used as a decision factor for any of the tools presented (unless you are building hello world apps ;). I am just using them as performance guideline when working on Dynamo.

What happens if we add more routes?

This benchmark also measures what happens if you add 10, 100 and 1000 /hello_world/#{i} routes and try to match the last /hello_world/1000 route.

What happens if I am serving a file?

@ybur-yug
ybur-yug / asciicast.md
Last active August 29, 2015 14:20
Volt::Tasks AsciiCast

Volt Tasks

Great thing about Volt - reuse between FE and backend. File manipulations and other ops asynch execute and return to frontend simply with promise

Beginning

First off, lets make a new volt app called server_stats

$ volt new server_stats

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

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

@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

@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 / 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
module Gkv
class Database
attr_accessor :items
def initialize
`git init`
@items = {}
end
def set(key, value)