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
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() { |
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
const util = require('util'); | |
const EventEmitter = require('events').EventEmitter; | |
function Fn(opts) { | |
function start() { | |
this.emit('start', opts); | |
} | |
// export public functions |
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
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 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 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 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
I've got | |
myProject | |
|- conf | |
|- lib | |
| |- myProject | |
| | |- Webservice | |
| | |- User.pm | |
| |- myProject.pm |
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
package myProject::Webservice; | |
use Mojo::Base 'Mojolicious::Controller'; | |
use constant true => 1; | |
use constant false => 0; | |
sub userLogin { | |
my $self = shift; | |
my $data = $self->req->json; |
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
Versions: | |
CORE | |
Perl (v5.14.2, linux) | |
Mojolicious (5.70, Tiger Face) | |
OPTIONAL | |
EV 4.0+ (not installed) | |
IO::Socket::Socks 0.64+ (not installed) | |
IO::Socket::SSL 1.84+ (1.999) |
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
/* | |
tcpdump -v -n -i lo -x | |
NMAP result (nmap -sS 127.0.0.1 -p 23) | |
root@debian:/home/zenetik# tcpdump -vvv -i lo -n ip | |
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes | |
21:50:20.794277 IP (tos 0x0, ttl 40, id 56063, offset 0, flags [none], proto TCP (6), length 44) | |
127.0.0.1.56649 > 127.0.0.1.23: Flags [S], cksum 0x17c8 (correct), seq 1809790236, win 1024, options [mss 1460], length 0 | |
21:50:20.794292 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 44) |
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
var socket = raw.createSocket({ | |
protocol: raw.Protocol.TCP | |
}); | |
/* | |
* calling new raw.packet will compute automagicaly ip header, pseudo header and tcp header, | |
* based on tcp headers and ip headers options passed in args | |
* |
NewerOlder