Skip to content

Instantly share code, notes, and snippets.

View danfragoso's full-sized avatar
🌭

Danilo Fragoso danfragoso

🌭
View GitHub Profile
@FrankBuss
FrankBuss / emulator.cpp
Last active June 20, 2024 19:05
RISC-V emulator (RV32I only) in one C++ file
/*
See https://gitlab.com/nedopc/npc5/blob/master/emu-rv32i.c for the latest version, with more features and less bugs :-)
RISCV emulator for the RV32I architecture
based on TinyEMU by Fabrice Bellard, see https://bellard.org/tinyemu/
stripped down for RV32I only, all "gotos" removed, and fixed some bugs for the compliance test
by Frank Buss, 2018
Requires libelf-dev:
@bijanebrahimi
bijanebrahimi / cross-compiler.sh
Last active April 17, 2024 19:54
build a linux cross compiler for FreeBSD targets
#!/bin/bash
export TARGET=amd64-marcel-freebsd9.2
export PREFIX=/usr/cross-build
export TARGET_PREFIX=$PREFIX/$TARGET
export PATH=$PATH:$PREFIX/bin
mkdir -p $TARGET_PREFIX{,/lib,/include}
mkdir build-{binutils,gmp,mpfr,mpci,gcc}
@diem1
diem1 / play.js
Created February 16, 2016 16:50
Play (mp3) audio file with AudioContext
window.onload = function(){
var context = new AudioContext() || new webkitAudioContext(),
request = new XMLHttpRequest();
request.open("GET", "audio_file.mp3", true);
request.responseType = "arraybuffer";
request.onload = function(){
context.decodeAudioData(request.response, onDecoded);
}
@mash
mash / Makefile
Created November 4, 2014 09:59
udp server sample using libuv
LIBUV_HOME := $(HOME)/src/github.com/joyent/libuv
LIBUV := $(LIBUV_HOME)/build/Release/libuv.a
INC = $(LIBUV_HOME)/include
all:
gcc -o main -I$(INC) -Wall main.c $(LIBUV)
PHONY: all
@DamonOehlman
DamonOehlman / README.md
Last active October 30, 2023 20:03
General WebRTC tips and tricks collated over time