São simples
'(1 2 3)
class Graph | |
Vertex = Struct.new(:name, :neighbours, :distance, :previous) | |
def initialize(graph) | |
@vertices = Hash.new do |key, value| | |
key[value] = Vertex.new(value, [], Float::INFINITY) | |
end | |
@edges = {} |
open -na /Applications/Skype.app --args -DataPath /Users/$(whoami)/Library/Application\ Support/Skype2 |
do (Backbone) -> | |
method = | |
cacheOrFetch: (options={}) -> | |
@_cache ?= @fetch(options) | |
_.extend(Backbone.Collection.prototype, method) |
Array.prototype.toSentence = -> | |
wordsConnector = ', ' | |
lastWordConnector = ' e ' | |
sentence = undefined | |
switch @length | |
when 0 | |
sentence = '' | |
when 1 | |
sentence = @[0] |
# Remap prefix Control + a | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
# Force a reload of the config file | |
unbind r | |
bind r source-file ~/.tmux.conf | |
# quick pane cycling |
{ | |
"auto_complete": false, | |
"auto_complete_commit_on_tab": true, | |
"auto_complete_delay": 0, | |
"bold_folder_labels": true, | |
"caret_extra_width": 5, | |
"gpu_window_buffer": true, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"hot_exit": false, |
[ | |
// jump between block | |
{"keys": ["alt+k"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false}}, | |
{"keys": ["alt+j"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true}}, | |
{"keys": ["shift+alt+k"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}}, | |
{"keys": ["shift+alt+j"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true}}, | |
// Origami | |
{ "keys": ["super+k", "super+w"], "command": "destroy_pane", "args": {"direction": "self"} }, |
window.scaler = function(options) { | |
var a, ab, b, c, cd, d, e, f, scale; | |
a = options.srcWidth; | |
b = options.srcHeight; | |
c = options.windowWidth; | |
d = options.windowHeight; | |
console.log(c, d); | |
ab = a / b; | |
cd = c / b; | |
e = 0; |
split = (array, numberOf) -> | |
matrix = [] | |
indice = 0 | |
aux = -1 | |
while indice < array.length | |
if indice % numberOf is 0 | |
aux++ | |
matrix[aux] = [] | |
matrix[aux].push array[indice] |