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
import React, { useRef, useEffect } from 'react' | |
import { useWorld, useSyncState, randomInt } from 'hyperfy' | |
export const blenderVec3 = ([x, y, z]) => [x, z, -y] | |
const headOffset = [ | |
[0,0,0],[0,0,0],[0,0,0] | |
] | |
export default function Heads() { |
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 udp = require('dgram'); | |
const yargs = require('yargs'); | |
const pump = require('pump'); | |
const argv = yargs | |
.option('mode', { | |
alias: 'm', | |
describe: 'client or server' | |
}).option('host', { | |
alias: 'h' | |
}).option('port', { |
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
# INSTALL DOCKER | |
sudo apt-get update | |
sudo apt-get install \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg |
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
<script src="https://unpkg.com/msgpackr@1.2.5/dist/index.js"></script> | |
<script src="https://unpkg.com/tweetnacl@1.0.3/nacl.min.js"></script> | |
<script src="https://bundle.run/buffer@6.0.3"></script> | |
// SIGNER | |
window.packr = new msgpackr.Packr({ structuredClone: true }); | |
const C = { | |
CONTRACT: 'c', | |
ACTION: 'a', |
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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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 DHT = require("@hyperswarm/dht"); | |
var pump = require("pump"); | |
var fs = require("fs"); | |
const crypto = require("hypercore-crypto"); | |
//const keyPair = crypto.keyPair(); | |
(async () => { | |
const node = new DHT(); | |
const keyPair = DHT.keyPair(); | |
await node.ready(); | |
const hash = crypto.data(Buffer.from("test", "utf-8")); |
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 DHT = require("@hyperswarm/dht"); | |
const crypto = require('hypercore-crypto') | |
const node = new DHT({}); | |
module.exports = (key='')=>{ | |
return { | |
serve: (command, cb)=>{ | |
const keyPair = crypto.keyPair(crypto.data(Buffer.from(key+command))); | |
const server = node.createServer(); | |
server.on("connection", function(socket) { |
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
'use strict' | |
const peerInfo = require('./lib/peer-info') | |
const peerQueue = require('./lib/queue') | |
const { EventEmitter } = require('events') | |
const network = require('@hyperswarm/network') | |
const MAX_SERVER_SOCKETS = Infinity | |
const MAX_CLIENT_SOCKETS = Infinity | |
const MAX_PEERS = 24 |
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
git clone https://github.com/Yahweasel/craig.git | |
cd craig | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
apt update | |
apt-get install -y ffmpeg vorbis-tools opus-tools libfdk-aac-dev zip unzip imagemagick php-imagick curl nodejs npm | |
cd cook | |
for i in *.c; do gcc -O3 -o ${i%.c} $i; done | |
for i in *.svg; do inkscape -e ${i%.svg}.png $i; done | |
npm install |
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
sudo docker build --force-rm=true --tag="root/cloud9-docker:latest" | |
docker run -it -d -p 7999:80 -p 7998:3000 --link mongodb -v /store/files:/store/files -v /home/lanmower/dev/:/meteor/ -v /home/lanmower/workspace:/workspace root/cloud9-docker | |
docker run -it -d -p 7997:80 -p 7996:3000 --link mongodb -v /home/lanmower/hh:/workspace root/cloud9-docker |
NewerOlder