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 / 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

@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 / 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 / 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"
REV b0ac8e8e11f7e63632cf5ae6495aacab5831d159
1167

REV f9b0f336bba3d90049242261e2dc4e9f0b17f639
1167

REV 8d5b14742e172a2f82ad9acfdefe816b5bbd5b4a
1356
#!/bin/bash
set -e
git rev-list --reverse HEAD | # get commits from latest to earliest
while read rev; do
echo; # print newline
echo REV $rev; # print REV some_hash
git ls-tree -r $rev | # recursively get all of the trees changed files
awk '{print $3}'| # get row 3 (shows entire changeset from commit)
run `mix test test/intro.exs` to continue
hello, world


  1) test saying hi to the planet (ElixirKoansTest)
     test/hello_world.exs:3
 Assertion with == failed
module Volt
class VoltLogger < Logger
... # removing unneeded parts from the module/classes
def log_dispatch(class_name, method_name, run_time, args)
@current = {
args: args,
class_name: class_name,
method_name: method_name,
run_time: run_time
/*
This CSS resource incorporates links to font software which is the valuable copyrighted
property of Monotype Imaging and/or its suppliers. You may not attempt to copy, install,
redistribute, convert, modify or reverse engineer this font software. Please contact Monotype
Imaging with any questions regarding Web fonts: http://webfonts.fonts.com
*/
@font-face {
font-family: "Helvetica-W01-Roman";
src: url("http://static.wix.com/services/third-party/fonts/user-site-fonts/fonts/ea95b44a-eab7-4bd1-861c-e73535e7f652.eot?#iefix");
extern crate threadpool;
use threadpool::ScopedPool;
fn main() {
let mut numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
{
let pool = ScopedPool::new(4);
for x in &mut numbers[..] {