Skip to content

Instantly share code, notes, and snippets.

View andersevenrud's full-sized avatar
🤘
w^w^^w^w

Anders Evenrud andersevenrud

🤘
w^w^^w^w
View GitHub Profile
@andersevenrud
andersevenrud / README.md
Last active June 24, 2024 17:54
UE5 on Arch

UE5 on Arch Linux

Just some personal in order to make Unreal Engine 5 compile on Arch Linux (25th of June 2022).

Don't even bother trying to make the marketplace run. You gotta do that shit under Wine (Lutris is great for auto-setup) and copy assets over to your Linux drive.

Dependencies:

sudo pacman -S dotnet-sdk xdg-user-dir clang make git
@andersevenrud
andersevenrud / README.md
Last active November 1, 2023 20:43
How to rotate (invert) Raspberry Pi 7" Touch LCD screen & input (RasPi 1, 2, 3)

Rotate Official Raspberry Pi 7" Touch Screen

Shows how to easily rotate (in this case invert to make orientation correct within a case) the Raspberry Pi 7" Touch Screen.

This will also update the calibration for the touch screen so it will work correctly.

References:

@andersevenrud
andersevenrud / index.js
Created September 12, 2020 20:41
Parse fstab
/**
* Parse fstab from either string (from file) or an array of lines
* @author Anders Evenrud <[email protected]>
* @license MIT
*/
const parse = input => (input instanceof Array ? input : input.split('\n'))
.map(line => line.replace(/\s+/g, ' ').replace(/(\s+)?,(\s+)?/g, ',').trim())
.filter(line => line.length > 0 && line.substring(0) !== '#')
.map(line => line.split(/\s/g))
.map(([dev, dir, type, options, dump, fsck]) => ({
@andersevenrud
andersevenrud / iframe.html
Created July 27, 2020 22:31
PoC to do bi-directional communiction between a parent and iframe document
<html>
<body>
<img id="image" />
<script>
const image = document.getElementById('image')
const postMessage = (data) => {
top.postMessage(JSON.stringify(data), '*')
}
@andersevenrud
andersevenrud / index.js
Created February 25, 2020 19:42
OS.js Webcam application example (localhost or https only)
//
// NOTE: THIS ONLY WORKS ON "localhost" OR A HOST WITH "https:"
//
import osjs from 'osjs';
import {name as applicationName} from './metadata.json';
const createVideoElement = () => {
const video = document.createElement('video');
video.style.width = '100%';
video.style.height = '100%';
@andersevenrud
andersevenrud / index.js
Last active July 24, 2021 06:07
OS.js x-frame-bypass iframe example
/*
This is just a demonstration of how this browser hack could be used
to make a "browser".
NOTE: This just bypasses *some* of the ways a browser allows loading
content within an iframe. Most google services etc does not work as
expected, and might just crash or not load.
*/
import './index.scss';
@andersevenrud
andersevenrud / README.md
Last active December 24, 2019 23:42
Very basic OS.js Chat application

Based on example from https://manual.os-js.org/v3/guide/framework/#react

Very basic chat application:

  • Uses a custom websocket server
  • Uses React to render UI
  • Uses event subscription model to handle websocket messages

THIS IS JUST FOR DEMONSTRATION PURPOSES

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active May 10, 2025 22:15
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@andersevenrud
andersevenrud / index.js
Last active April 1, 2019 19:41
Simple OS.js Application w/Server API
//
// Just a standard OS.js application
//
// The "index.js" file.
//
import osjs from 'osjs';
import {name as applicationName} from './metadata.json';
const register = (core, args, options, metadata) => {
const proc = core.make('osjs/application', {args, options, metadata});
import './index.scss';
import osjs from 'osjs';
import {name as applicationName} from './metadata.json';
import {h, app} from 'hyperapp';
import {Box, BoxContainer, Button, Toolbar, TextField, SelectField} from '@osjs/gui';
///////////////////////////////////////////////////////
// Custom GUI Elements
///////////////////////////////////////////////////////