Skip to content

Instantly share code, notes, and snippets.

View 7415963987456321's full-sized avatar

7415963987456321

  • Kópavogur
View GitHub Profile
// This stuff for work that I had to do at home
async function reloadImg(el) {
var elurl = el.src
await fetch(elurl, { cache: 'no-store', mode: 'no-cors' })
.then(
// Maybe append # to force cache reload
x => {
el.src = ""
@7415963987456321
7415963987456321 / stacktrace
Created March 17, 2021 00:10
SIGESEGV in nvim
fish: Job 3, 'nvim $argv' terminated by signal SIGSEGV (Address boundary error)
PID: 4067052 (nvim)
UID: 1000 (keli)
GID: 1000 (keli)
Signal: 11 (SEGV)
Timestamp: Tue 2021-03-16 00:14:13 GMT (23h ago)
Command Line: nvim nature.cpp
Executable: /usr/bin/nvim
@7415963987456321
7415963987456321 / dfa.c
Created December 19, 2019 14:21
Pointer weirdness on dynamic allocation of structs
#define BUFSIZE 1000
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
/* Forward declaration */
@7415963987456321
7415963987456321 / increment.c
Created September 27, 2019 16:29
Heppi berthday
#include <stdio.h>
#define NAME "JOSHAA"
#define CURRENT_AGE 25
unsigned int increment_age(unsigned int age) {
return age = -(~age);
}
int main(int argc, const char *argv[]) {
puts("Happi berthday " NAME);
@7415963987456321
7415963987456321 / alacritty.recording
Created August 27, 2019 20:04
alacritty --ref-test
]4;0;#090B13\]4;1;#4C3A42\]4;2;#6B4E4A\]4;3;#8C4F3D\]4;4;#97684E\]4;5;#B28C62\]4;6;#CEA966\]4;7;#e6d8b4\]4;8;#a1977d\]4;9;#4C3A42\]4;10;#6B4E4A\]4;11;#8C4F3D\]4;12;#97684E\]4;13;#B28C62\]4;14;#CEA966\]4;15;#e6d8b4\]10;#e6d8b4\]11;#090B13\]12;#e6d8b4\]13;#e6d8b4\]17;#e6d8b4\]19;#090B13\]4;232;#090B13\]4;256;#e6d8b4\]708;#090B13\]0;fish /home/keli/code/alacritty/target/release(B __ __ __ _ ___ __
_ / / \ \ / / _ | | _ [38;
@7415963987456321
7415963987456321 / gdblog.txt
Created February 1, 2019 02:25
Segfault with pointer_contraint enabled
sway version 1.0-beta.2-300-g204e1f47 (Feb 1 2019, branch 'master')
keli@keli~> coredumpctl gdb sway
PID: 8533 (sway)
UID: 1000 (keli)
GID: 985 (users)
Signal: 11 (SEGV)
Timestamp: Fri 2019-02-01 02:08:25 GMT (14min ago)
Command Line: sway -d
void apply_output_config(struct output_config *oc, struct sway_output *output) {
struct wlr_output *wlr_output = output->wlr_output;
if (!oc) {
if (!output->enabled) {
if (oc->dpms_state != DPMS_OFF) {
wlr_output_enable(wlr_output, true);
}
output_enable(output, oc);
@7415963987456321
7415963987456321 / sway.log
Created December 5, 2018 17:14
Sway log output
2018-12-05 17:12:07 - [sway/sway/server.c:34] Preparing Wayland server initialization
2018-12-05 17:12:07 - [backend/session/logind.c:537] Successfully loaded logind session
2018-12-05 17:12:07 - [backend/backend.c:142] Found 1 GPUs
2018-12-05 17:12:07 - [backend/drm/backend.c:151] Initializing DRM backend for /dev/dri/card0 (i915)
2018-12-05 17:12:07 - [backend/drm/drm.c:63] Using atomic DRM interface
2018-12-05 17:12:07 - [backend/drm/drm.c:156] Found 3 DRM CRTCs
2018-12-05 17:12:07 - [backend/drm/drm.c:87] Found 9 DRM planes
2018-12-05 17:12:07 - [backend/drm/drm.c:129] (3 overlay, 3 primary, 3 cursor)
2018-12-05 17:12:07 - [render/egl.c:149] Using EGL 1.4
2018-12-05 17:12:07 - [render/egl.c:150] Supported EGL extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_IMG_context_priority EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fenc
@7415963987456321
7415963987456321 / get_inputs.log
Created November 30, 2018 20:18
Output from swaymsg -t get_inputs
[
{
"identifier": "0:0:Acer_WMI_hotkeys",
"name": "Acer WMI hotkeys",
"vendor": 0,
"product": 0,
"type": "keyboard",
"xkb_active_layout_name": "Icelandic"
},
{
@7415963987456321
7415963987456321 / gdb.txt
Created November 28, 2018 14:42
coredumctl gdb sway
#0 0x0000555fad3a4c86 in scratchpad_toggle_auto () at ../sway/commands/scratchpad.c:34
i = 0
seat = 0x555fae922330
focus = 0x0
ws = 0x0
__func__ = "scratchpad_toggle_auto"
con = 0x100000002
#1 0x0000555fad3a4ffa in cmd_scratchpad (argc=1, argv=0x555fae8df128) at ../sway/commands/scratchpad.c:118
error = 0x0
#2 0x0000555fad374507 in execute_command (_exec=0x555fae8e4cd0 "scratchpad show", seat=0x555fae922330, con=0x0) at ../sway/commands.c:310