Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
blaenk committed May 12, 2015
0 parents commit 5ebdb1f
Show file tree
Hide file tree
Showing 253 changed files with 29,112 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "site"
version = "0.1.0"
authors = ["Jorge Israel Peña <jorge.israel.p@gmail.com>"]

[dependencies]
toml = "*"
regex = "*"
glob = "*"

# due to diecast
log = "*"
env_logger = "*"
rustc-serialize = "*"
time = "*"

# templates
handlebars = "*"

# ws
websocket = "*"

# git
git2 = "*"

# rss
rss = "*"

[dependencies.diecast]
path = "../diecast"

# due to diecast
[dependencies.typemap]
path = "../../rust-typemap"

1 change: 1 addition & 0 deletions input/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.blaenkdenum.com
Empty file added input/drafts/.gitkeep
Empty file.
8 changes: 8 additions & 0 deletions input/drafts/notes/bitcoin.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Bitcoin
published: October 24, 2014
excerpt: The first decentralized cryptocurrency
comments: off
toc: left
---

545 changes: 545 additions & 0 deletions input/drafts/notes/diecast.markdown

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions input/drafts/notes/distributed-systems.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Distributed Systems
published: September 15, 2014
excerpt: Solving problems with multiple computers
comments: off
toc: left
---

I'm using [Distributed Systems for Fun and Profit] for an introduction to the field of distributed systems.

[Distributed Systems for Fun and Profit]: http://book.mixu.net/distsys/

_Scalability_ is the ability of a system, network, or process to handle a increasing work in a capable manner. _Availability_ is the proportion of a system is in functioning condition. _Fault tolerance_ is the ability to behave in a well-defined manner when faults occur.

Distributed systems are constrained by the number of nodes and the distance between them. Varying these quantities has an effect on the distributed system. Increasing the number of nodes increases the probability of failure in the system (reducing availability) and may increase the need for communication between them (reducing performance). Increasing the distance between the nodes increases the minimum latency.

Abstractions and models are often used to facilitate the conceptualization and design of distributed systems by removing certain real-world aspects that aren't relevant to solving the problem. The types of models may include system models, failure models, and consistency models.

The distribution of the necessary data can affect perfromance and fault tolerance. _Partitioning_ refers to splitting the data over multiple nodes to increase parallel processing. _Replication_ refers to copying or caching data on multiple nodes to reduce the distance between the client and the server, which also increasing fault tolerance.
51 changes: 51 additions & 0 deletions input/drafts/notes/julia.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Julia
published: July 23, 2014
excerpt: A high-performance dynamic language for numerical computing
comments: off
toc: left
---

# Types

There are signed and unsigned integers of the form `Intx` and `Uintx` ranging from 8 to 128, as well as `Int` and `Uint` which are aliases for the type representing machine's word size, which itself is available as `WORD_SIZE`. Floating-point types take the form `Floatx` from 16 to 64.

Integer literals take on a type depending on the machine's word size, though if they are too large to fit in 32-bits then they are represented as `Int64`, regardless of the machine's word size.

Unsigned integer literals are written in hexadecimal.

Floating-point literals are inferred as `Float64` values, and `Float32` literals can be entered by using scientific exponent notation with an `f` instead of an `e`.

The `typemin` and `typemax` functions can be used to yield the minimum and maximum bounds for a type.

It's possible to find the distance between two adjacent representable floating-point numbers, a distance known as machine epsilon. The `eps` function can give the distance between 1.0 and the next larger representable floating-point value for a particular type.

The `eps` function can also take a floating-point value, in which case it returns the absolute value of difference between the value and the next representable floating-point value, so that `x + eps(x)` is the next representable floating-point value greater than `x`.

The next or previous representable floating-point number can also be retrieved using the `nextfloat` and `prevfloat` functions.

The `BigInt` and `BigFloat` types can be used to create arbitrary precision integers and floating-point numbers, which are constructed by passing the number as a string.

Variables can be immediately preceded by numeric literals and thereby imply multiplication, simplifying the writing of polynomial expressions. These are known as numeric literal coefficients. The precedence of numeric literal coefficients is the same as unary operators, so they can also precede parentheses and other things.

``` julia
2x^2 - 3x + 1
2(x-1)^2 - 3(x-1) + 1
```

Parenthesized expressions can also be used as coefficients to variables to imply multiplication of the expression by the variable.

``` julia
(x-1)x
```

The `zero` and `one` functions return a literal 0 or 1 depending on the type of the given variable or the provided type. They're useful to avoid overheard from unnecessary type conversions.

The `^` operator can be used to raise a number to a specific power. The `\` operator is the inverse divide operator, which flips the arguments of `/`. The dollar sign `$` is the XOR operator.

In Julia, comparisons can be chained.

``` julia
1 < 2 <= 2 < 3 == 3 > 2 >= 1 == 1 < 3 != 5
```

28 changes: 28 additions & 0 deletions input/drafts/notes/rabbitmq.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: RabbitMQ
published: July 27, 2014
excerpt: Open source AMQP-compliant message broker
comments: off
toc: left
---

For every TCP connection there could be multiple channels through which AMQP commands may be sent, each channel with its own unique ID. There are three parts to successful routing of an AMQP message: exchanges, queues, and bindings. Exchanges are where produces publish messages, bindings are how messages get routed from an exchange to a given queue, and queues are where messages end up.

*[AMQP]: Advanced Message Queuing Protocol

Consumers can receive messages from a queue by subscribing with `basic.consume`, which automatically takes another message off of the queue after consuming or rejecting the previous one. Alternatively, it's possible to consume a single message off of the queue using `basic.get`, which essentially subscribes to the queue and unsubscribes after retrieving a single message.

If a message arrives at a queue and there are no subscribed consumers, it waits there until one subscribes and consumes it off of the queue. Conversely, if there are multiple consumers, messages are served to them in a round-robin fashion. Messages that are published to an exchange that has no queue to be routed to are discarded by RabbitMQ.

Every consumed message must be acknowledged either by sending an explicit acknowledge with `basic.ack` or setting the `auto_ack` parameter to true when subscribing to the queue, which automatically considers a message to be acknowledge as soon as the consumer receives it.

If a consumer receives a message and disconnects before acknowledging, RabbitMQ redelivers it to the next subscribed consumer. If instead a consumer simply forgets to acknowledge a message, it won't be sent anymore messages since it assumes that the consumer isn't finished processing the unacknowledged message.

It's possible to explicitly reject a message instead of acknowledging it, either by disconnecting from RabbitMQ or on RabbitMQ > 2.0 using the `basic.reject` command. Using `basic.reject`, if the `requeue` parameter is set to true, RabbitMQ will redeliver the message to the next subscribed consumer. In future versions of RabbitMQ, setting the `requeue` parameter to false can send the message to a dead letter queue which can be used for inspection. Alternatively, a message can be discarded by simply acknowledging it.

Queues can be created by consumers or producers using the `queue.declare` command, but consumers can't declare a queue while subscribed to another on the same channel. Consumers must first unsubscribe, placing the queue in transmit mode. If a queue name isn't provided, a random one is created.

Queues can be set as exclusive or auto-delete. Exclusive makes the queue private so that it can only be consumed by one consumer. Auto-delete automatically deletes the queue when the last consumer unsubscribes.

If an existing queue is declared, and all parameters match the existing queue, RabbitMQ considers the declaration successful and fail otherwise. A queue can be checked for existence by setting the `passive` parameter to true.

Binary file added input/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/3dmath.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/algorithms.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/bitcoin.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/clojure-web-development.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/clojure.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/cppprimer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/debugging.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/direct3d11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/dspguide.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/erlang.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/gof.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/haskellconpar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/hfdesignpatterns.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/iosnerdranch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/java.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/kingkiller.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/kingkiller2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/lyah.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/metaruby.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/mistborn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/mistborn2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/mistborn3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/onchina.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/play.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added input/images/books/rwh.jpg
Binary file added input/images/books/scala.jpg
Binary file added input/images/books/swift.jpg
Binary file added input/images/books/tlpi.jpg
Binary file added input/images/books/wayofkings.jpg
Binary file added input/images/books/wor.jpg
Binary file added input/images/me.png
Binary file added input/images/notes/algorithms/tries/trie.png
Binary file added input/images/notes/diecast/dependency-graph.png
Binary file added input/images/notes/haskell/amdahls-law.png
Binary file added input/images/posts/dots/deploy.png
Binary file added input/images/posts/dots/less.png
Binary file added input/images/posts/dots/prompt.png
Binary file added input/images/posts/dots/tmux.png
85 changes: 85 additions & 0 deletions input/js/blaenk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
$(function() {
var mobilenav = $('#mobile-nav');

$('html').click(function(){
mobilenav.find('.on').each(function(){
$(this).removeClass('on').next().hide();
});
});

mobilenav.on('click', '.menu .button', function(e){
if (!$(this).hasClass('on')) {
var width = $(this).width() + 42;
$(this).addClass('on').next().css({width: width}).show();
} else {
$(this).removeClass('on').next().hide();
}
}).on('click', '.search .button', function(e){
if (!$(this).hasClass('on')){
var width = mobilenav.width() - 51;
mobilenav.children('.menu').children().eq(0).removeClass('on').next().hide();
$(this).addClass('on').next().show().css({width: width}).children().children().eq(0).focus();
} else {
$(this).removeClass('on').next().hide().children().children().eq(0).val('');
}
}).click(function(e){
e.stopPropagation();
});

var $nav = $('#main-nav .main');

var toggleForm = function(button, form) {
button.click(function() {
if (form.is(':visible')) {
form.fadeOut('fast');
} else {
form.fadeIn('fast');
form.find('input').focus();
}
});

form.find('input').keyup(function(e) {
if (e.keyCode == 27) {
form.fadeOut('fast');
}
});
};

toggleForm($('#search_btn'), $('.desk_search'));

window.refresh = function () {
$('.collapse').not(function() {
return "#" + $(this).attr('id') == window.location.hash;
}).next('.collapsible').hide();

$('.collapse').click(function(e) {
e.preventDefault();
$(this)
.next('.collapsible')
.slideToggle('fast');
});

var $footnotes = $('.footnotes > ol > li');

$('.footnoteRef')
.attr('title', 'read footnote')
.click(function() {
$footnotes.stop(true, true)

var note = $(this).attr('href');
$footnotes.not(note)
.css({opacity: 0.1})
.animate({opacity: 1.0}, 15000, 'linear');
});

$('a[href^="#fnref"]')
.attr('title', 'continue reading')
.html('<i class="fa fa-level-up"></i>')
.click(function() {
$footnotes.stop(true, true);
});

};

window.refresh();
});
Loading

0 comments on commit 5ebdb1f

Please sign in to comment.