Skip to content

Instantly share code, notes, and snippets.

@shnupta
shnupta / ftxhula_logs.cc
Created September 6, 2025 02:57
another gpt creation
#include <ftxui/component/loop.hpp>
#include <ftxui/component/component.hpp>
#include <ftxui/component/component_options.hpp>
#include <ftxui/component/screen_interactive.hpp>
#include <ftxui/dom/elements.hpp>
#include <hulaloop/loop.h>
#include <hulaloop/repeater.h>
#include <string>
@shnupta
shnupta / ftxhula.cc
Created September 6, 2025 02:26
gpt generated ftxui rendering from custom event loop
#include <ftxui/component/loop.hpp>
#include <hulaloop/loop.h>
#include <hulaloop/repeater.h>
#include <ftxui/dom/elements.hpp>
#include <ftxui/dom/canvas.hpp>
#include <ftxui/component/screen_interactive.hpp>
#include <ftxui/component/component.hpp>
#include <chrono>
@shnupta
shnupta / UnderstandGameFile.cs
Created April 8, 2019 17:21
A quick program that will read in the 2019 AQA Skeleton Program binary game file and output a list of the items and their info.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnderstandGameFile
{
class Program
@shnupta
shnupta / init.vim
Last active November 14, 2018 16:19
Neovim initialisation file
call plug#begin('~/.local/share/nvim/plugged')
" Themes
Plug 'https://github.com/danilo-augusto/vim-afterglow'
Plug 'mhinz/vim-janah'
" Status lines
Plug 'itchyny/lightline.vim'
" Startup
@shnupta
shnupta / did.sh
Last active November 10, 2018 14:43
My macOS version of Alexis Janvier's did shell script.
export MDV_THEME=729.8953
export DID_PATH=~/.did
function did(){
export LC_ALL=C
mkdir -p ${DID_PATH}
if [ ! -f ${DID_PATH}/$(date +%Y-%V).md ]; then
echo -e "# Week $(date +"%V (%B %Y)") \n\n## $(date +"%A %d-%m-%y")" > ${DID_PATH}/$(date +%Y-%V).md
fi
#!/bin/bash
function err_echo {
>&2 echo "$1"
}
function usage {
err_echo "usage:"
err_echo ' change old new foo.txt'
err_echo ' change old new foo.txt *.html'
err_echo ' change old new **\*.txt'
dotspacemacs-configuration-layers
'(
html
markdown
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them.
;; ----------------------------------------------------------------
ivy
@shnupta
shnupta / vim_cheatsheet.md
Last active July 24, 2017 16:02
Quick cheatsheet for vim

Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words)
  • W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
@shnupta
shnupta / configuration.nix
Last active May 30, 2017 21:13
My NixOS configuration file for Macbook Pro 2015
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
# Make sure to add
# boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
# to the hardware-configuration.nix file
{ config, pkgs, ... }:
@shnupta
shnupta / sdl_mouse.c
Created February 16, 2017 00:11
A quick mash together of SDL2 to answer a stackoverflow question on mouse input.
#include <SDL2/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
char* itoa(int i, char b[]){
char const digit[] = "0123456789";
char* p = b;