Skip to content

Instantly share code, notes, and snippets.

View nuno1212s's full-sized avatar

Nuno Neto nuno1212s

View GitHub Profile
#!/bin/bash
MACHINES=("safe01" "safe02" "safe03" "safe04" "safe-gpu" "cop01" "cop02" "cop03" "cop04")
SESSION_NAME="ClusterDcc"
tmux kill-session -t $SESSION_NAME
tmux new-session -ds $SESSION_NAME
USER="nneto"
pub fn bind_and_connect<A: Into<SocketAddr>>(addr: A, bind_ip: IpAddr) -> io::Result<Socket> {
let addr = addr.into();
let host = match SockaddrIn::from_str(match bind_ip {
IpAddr::V4(ipv4) => {
format!("{}:{}", ipv4, addr.port())
}
IpAddr::V6(_) => {
@nuno1212s
nuno1212s / ScrollingString.java
Last active February 15, 2016 14:59 — forked from DarkBlade12/ScrollingString.java
Implementation of a scrolling string.
public class ScrollingString {
private String original;
private int width;
private int position;
private ChatColor color = ChatColor.RESET;
public ScrollingString(String original, int width) {
this.original = original;
//Allow for colors
this.width = width-2;