This file contains hidden or 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
package MyApp; | |
use Mojo::Base 'Mojolicious'; | |
sub startup { | |
my $self = shift; | |
$self->secrets(["gwhiddens3cr3ts"]); | |
$self->sessions->default_expiration(3600*24*7); | |
$self->sessions->cookie_name('SESSION'); |
This file contains hidden or 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
const cidrClean = require('cidr-clean'); | |
let list = [ | |
'1.0.0.0/8', | |
'100.1.1.12/31', | |
'100.1.1.2/31', | |
'100.1.1.4/30', | |
'100.1.1.8/30', | |
'100.10.1.44/30', | |
'100.10.1.54/31', |
This file contains hidden or 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
var net = require('net'); | |
// creates the server | |
var server = net.createServer(); | |
//emitted when server closes ...not emitted until all connections closes. | |
server.on('close',function(){ | |
console.log('Server closed !'); | |
}); |
This file contains hidden or 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
const util = require('util'); | |
const EventEmitter = require('events').EventEmitter; | |
function Fn(opts) { | |
function start() { | |
this.emit('start', opts); | |
} | |
// export public functions |
This file contains hidden or 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
export const Crosshair = ({position}) => { | |
// adapted from https://codepen.io/driezis/pen/jOPzjLG | |
const vertexShader = ` | |
uniform float rotation; | |
uniform vec2 center; | |
#include <common> | |
varying vec2 vUv; | |
void main() { |
OlderNewer