This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vertx.eventBus().consumer( "com.makingdevs.my.first.verticle" ){ message -> | |
String deploymentId = vertx.getOrCreateContext().deploymentID | |
println "This consumer has this deployment ID ${deploymentId})" | |
println "The message received by this verticle is ${message.body}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vertx.eventBus().consumer("com.makingdevs.ping"){ message -> | |
println "Message Received: ${message.body()}" // Pong! | |
message.reply("ping") | |
} | |
vertx.eventBus().send("com.makingdevs.ping", "pong"){ reply -> | |
if(reply.suceeded()){ | |
println "Reply Received: ${reply.result().body()}" // Ping! | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in 1...50 { | |
if i%5==0 && i%3==0 { | |
print("Fizzbuzz 🍻 ") | |
} | |
else if i%5 == 0{ | |
print("Buzz") | |
} | |
else if i%3==0{ | |
print("Fizz") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sendSlackMessage(message:String, emoji:String){ | |
let slackUrl = "http://your-slack-channel-url.com" | |
Alamofire.request(slackUrl, | |
method: .post, | |
parameters: | |
["channel": "#general", | |
"username": "Home Office Bot", | |
"text":message, "icon_emoji":emoji], | |
encoding: JSONEncoding.default) | |
.responseString{ response in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fib1(n: UInt) -> UInt { | |
if(n<2){ | |
return n | |
} | |
return fib1(n: n-2) + fib1(n: n-1) | |
} | |
fib1(n: 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Segunda Versión*/ | |
var fibMemo: [UInt:UInt] = [0: 0, 1: 1] | |
func fib2(n:UInt)-> UInt{ | |
if let result = fibMemo[n] { | |
return result | |
} else { | |
fibMemo[n] = fib2(n: n-1) + fib2(n: n-2) | |
} | |
return fibMemo[n]! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Tercera Versión */ | |
func fib3(n:UInt) -> UInt{ | |
if (n==0){ | |
return n | |
} | |
var last: UInt = 0 | |
var next: UInt = 1 | |
for _ in 1..<n{ | |
(last, next) = (next, last+next) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g prefix C-a | |
unbind C-b | |
set -sg escape-time 1 | |
set -g base-index 1 | |
setw -g pane-base-index 1 | |
bind r source-file ~/.tmux.conf \; display "Configuración recargada" | |
bind C-a send-prefix | |
bind | split-window -h -c "#{pane_current_path}" | |
bind - split-window -v -c "#{pane_current_path}" | |
bind c new-window -c "#{pane_current_path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g prefix C-a | |
unbind C-b | |
set -sg escape-time 1 | |
set -g base-index 1 | |
setw -g pane-base-index 1 | |
bind r source-file ~/.tmux.conf \; display "Configuración recargada" | |
bind C-a send-prefix | |
bind | split-window -h -c "#{pane_current_path}" | |
bind - split-window -v -c "#{pane_current_path}" | |
bind c new-window -c "#{pane_current_path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT='%{$fg[yellow]%}𝝺 %{$fg[green]%}%c 🍷 $(git_prompt_info)%{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%} %{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX=" %{$fg[red]%}❯%{$fg[yellow]%}❯%{$fg[green]%}❯ " |
OlderNewer