Skip to content

Instantly share code, notes, and snippets.

@Log1x
Log1x / README.md
Last active November 28, 2023 21:15
Uptime Robot Discord Webhook

Uptime Robot Webhook for Discord

Screenshot

Configuration

  • Alert Contact Type: Web-Hook
  • URL to Notify: https://discordapp.com/api/webhooks/CHANGEME/CHANGEME?
    • Must end with ?
@cesarmiquel
cesarmiquel / process-vga-pallette.php
Created April 16, 2020 04:39
VGA 256 Color Palette to RGB
<?php
$im = imagecreatefrompng("vga-palette.png");
$sx = (int) 800 / 16;
$sy = (int) 800 / 16;
$ox = (int) ($sx / 2);
$oy = (int) ($sx / 2);
for($y = 0; $y < 16; $y++) {
for($x = 0; $x < 16; $x++) {
$rgb = imagecolorat($im, $sx*$x + $ox, $sy*$y + $oy);

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@pvieito
pvieito / VGASimulator.py
Created May 17, 2016 23:06
Simulate and view VGA output from a VHDL simulation
#!/usr/bin/env python3
'''VGASimulator.py - Pedro José Pereira Vieito © 2016
View VGA output from a VHDL simulation.
Ported from VGA Simulator:
https://github.com/MadLittleMods/vga-simulator
by Eric Eastwood <contact@ericeastwood.com>
More info about how to generate VGA output from VHDL simulation here:
http://ericeastwood.com/blog/8/vga-simulator-getting-started
@tikolakin
tikolakin / fish_alias.md
Last active May 2, 2024 14:21
Create alias in Fish shell and save this as a permanent function

Directly from CLI

alias x='exit'
funcsave x

or create a file in

~/.config/fish/functions 

with name

@rafaelcorsi
rafaelcorsi / AtmelStudio7-make-to-linux.sh
Last active May 29, 2020 07:04
Convert Atmel Studio 7 generated makefile (windows paths) to linux, so you can compile your project from linux
#!/bin/sh
# Rafael Corsi
# corsiferrao@gmail.com
#
# Script to convert makefile generate from atmel studio 7 (windows)
# to linux path, assuming that you have gcc on PATH
#
# on Arch
# - sudo pacman -S arm-none-eabi-gcc
@limingjie
limingjie / 256 colors.md
Last active April 24, 2024 22:15
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

Add this line to ~/.tmux.conf

@sivachandran
sivachandran / bin2h.cmake
Last active December 7, 2023 22:19
Pure CMake function to convert any file into C/C++ header, implemented with only CMake commands.
include(CMakeParseArguments)
# Function to wrap a given string into multiple lines at the given column position.
# Parameters:
# VARIABLE - The name of the CMake variable holding the string.
# AT_COLUMN - The column position at which string will be wrapped.
function(WRAP_STRING)
set(oneValueArgs VARIABLE AT_COLUMN)
cmake_parse_arguments(WRAP_STRING "${options}" "${oneValueArgs}" "" ${ARGN})