Skip to content

Instantly share code, notes, and snippets.

EventLoopGroup group = new NioEventLoopGroup();
ChannelGroup channels = new DefaultChannelGroup(group.next());
try {
for(UdpLoadBalancerConfig config : configList) {
System.out.println("Started load balancer on port: " + config.port + " and with servers: " + java.util.Arrays.toString(config.servers));
Bootstrap b = new Bootstrap();
b.group(group)
.channel(NioDatagramChannel.class)
.option(ChannelOption.SO_BROADCAST, true)
.handler(new UdpLoadBalancerHandler(config.servers, debug));
@harvyso
harvyso / ImportSVGToSymbol.html
Created February 23, 2018 17:52 — forked from netpoetica/ImportSVGToSymbol.html
In Paper.js, use importSVG to import an svg node to a useable symbol and remove it from the DOM.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Paperjs - ImportSVG to Symbol</title>
<script type="text/javascript" src="js/lib/paper.js"></script>
<script type="text/paperscript" canvas="canvas">
function SVGSymbol(elem){
var a = new Symbol(paper.project.importSvg(elem));
elem.parentNode.removeChild(elem);
@harvyso
harvyso / git.migrate
Created February 14, 2018 13:15 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@harvyso
harvyso / app.css
Created February 10, 2018 10:07 — forked from scottdomes/app.css
React Audio Tutorial
body {
background: #f9f9f9;
font-family: 'Open Sans', sans-serif;
text-align: center;
}
#container {
position: relative;
z-index: 2;
padding-top: 100px;