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
//Encoding: | |
float2 atanYX = atan2(normalIn.y,normalIn.x); | |
float2 normalOut = float2(atanYX/PI,normalIn.z); | |
normalOut = (normalOut+1.0)+0.5; | |
//Decoding: | |
float2 angles = normalOut*2.0- 1.0; | |
float2 theta = sincos(angles.x*PI,theta.x,theta.y); | |
float2 phi = float2(sqrt(1.0- angles.y*angles.y),angles.y); | |
float3 normal = float3(theta.y*phi.x,theta.x*phi.x,phi.y); |
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
colors: | |
primary: | |
background: '0x333333' | |
foreground: '0xd3d0c8' | |
cursor: | |
text: '0x000000' | |
cursor: '0xffffff' | |
normal: | |
black: '0x000000' | |
red: '0xf2777a' |
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
%dw 2.0 | |
output application/json | |
fun mapUntil<T, V>( | |
iterableList: Array<T>, | |
predicate: (element: T, index: Number) -> ({value: V} | {done: Boolean}), | |
startIndex: Number = 0 | |
) = | |
iterableList match { | |
case [] -> [] |
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
{ws=explicit} | |
Document ::= WS* Forms EOF {ws=implicit} | |
Form ::= (&"(" List | &"[" Vector | &"{" Map| &"#{" Set| &"'" Quote| &"`" Backtick| &"@" Deref| &"~@" UnquoteSplicing| &"~" Unquote| &"#(" Lambda| !';' Symbol| &":" Keyword | Literal | Discard | Dispatch | Regex) {pin=1,fragment=true} | |
Forms ::= (Form WS* | Comment WS*)* {fragment=true} | |
List ::= OPEN_PAREN WS* Forms? WS* CLOSE_PAREN {pin=1,recoverUntil=CLOSE_PAREN} | |
Vector ::= OPEN_ARRAY WS* Forms? WS* CLOSE_ARRAY {pin=1,recoverUntil=CLOSE_ARRAY} |
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 enum NatType { | |
Other = 0, | |
SymmetricNAT = 1, | |
NoNAT = -1 // No NAT (Open Internet, Blocked, Symmetric UDP Firewall) | |
} | |
export async function detectNat(): Promise<NatType> { | |
const candidates = new Map<number, number[]>(); | |
const pc = new RTCPeerConnection(peerConnectionConfig); |
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
// This configuration is passed when we create a new peer connection object. | |
// It provides a set of servers used to establish a connection. STUN servers | |
// are used to discover our external IP address, and TURN servers (none listed | |
// here) are used to proxy a connection when a peer is behind a restrictive | |
// firewall that prevents a direct connection. | |
var peerConnectionConfig = { | |
iceServers: [ | |
{ urls: "stun:stun.l.google.com:19302" }, | |
{ urls: "stun:stun1.l.google.com:19302" }, | |
{ urls: "stun:stun2.l.google.com:19302" }, |
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 bb = require("./bytebuffer"); | |
const fs = require("fs"); | |
function loadBB(src) { | |
return bb.wrap(fs.readFileSync(src)); | |
} | |
function loadCabecera(bb) { | |
bb.skip(255 + 4 + 4); | |
} |
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
gpg-connect-agent <<EOF | |
/hex | |
scd serialno | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 | |
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40 |
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
environment = {{}} | |
target = "lua" | |
function nil63(x) | |
return(x == nil) | |
end | |
function is63(x) | |
return(not nil63(x)) | |
end | |
function no(x) | |
return(nil63(x) or x == false) |
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
// tslint:disable:ter-indent | |
import { ScriptableScene, createElement } from 'metaverse-api' | |
export default class SharkAnimation extends ScriptableScene { | |
state = { | |
bitestate: 0 | |
} | |
async sceneDidMount() { | |
this.eventSubscriber.on(`muhshark_click`, xxx => { |