Skip to content

Instantly share code, notes, and snippets.

@cb372
cb372 / riscv.md
Last active June 8, 2024 10:09
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

/* eslint-disable */
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const babelConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, '../.babelrc'))
)
module.exports = {
entry: ['babel-polyfill', path.join(__dirname, '../index.web.js')],
@ljfa-ag
ljfa-ag / modelbase_to_json.perl
Last active November 1, 2022 14:02
Script for converting exported Techne models for Minecraft into other model formats
#!/usr/bin/env perl
# Released into Public Domain
# A quick and dirty script to convert ModelBase Java code as generated
# by Techne (or possibly Tabula) into Minecraft's JSON model format.
# It is quite limited (it does not handle rotations, as the JSON model format
# is limited in that regard anyway), but it is at least a help.
# Usage:
# modelbase_to_json input.java > output.json
@aadnk
aadnk / ExampleMod.java
Last active December 6, 2022 18:28
Hide or show players in the player list only (TAB).
package com.comphenix.example;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class ExampleMod extends JavaPlugin {
private HidePlayerList playerList;
@chitan
chitan / WsChatServlet.java
Created July 7, 2012 01:44
How to use WebSocket of Tomcat
//This sample is how to use websocket of Tomcat.
package wsapp;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.ArrayList;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;