Skip to content

Instantly share code, notes, and snippets.

View jbyuki's full-sized avatar
💭

Julien Burkhard jbyuki

💭
View GitHub Profile
@jbyuki
jbyuki / README.md
Last active May 16, 2021 22:26
Forward neural-net using SYCL

Forward net using SYCL

1-hidden layer feedforward neural network solving the XOR problem.

Table of contents:

  • main.cpp : Implementation of XOR problem using SYCL
  • main.cpp.t : Literate source code for main.cpp written using ntangle.nvim
  • xor.py : Same program written in python using numpy
@jbyuki
jbyuki / Notes.md
Created May 11, 2021 18:24
oneAPI DPC++ Windows Compilation

Specs

Visual Studio 2019 Windows

Issue

MSBUILD : error MSB1008: Only one project can be specified.

@jbyuki
jbyuki / CMakeLists.txt
Last active September 14, 2020 06:55
CMakeLists.txt to build lua and C++ test program
# Build lua (last commit : 6bc0f13)
cmake_minimum_required(VERSION 3.1)
project(lua)
add_library(lua STATIC
lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c ldblib.c ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c ltests.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c)
@jbyuki
jbyuki / ntangle.vim.tl
Created August 25, 2020 13:36
literal programming plugin for VIM
@*=
@script_variables
@functions
@functions+=
function! TangleCurrentBuffer(outputdir)
@skip_if_one_line_or_less
@parse_variables
@read_line_by_line
@traverse_node_and_output
@jbyuki
jbyuki / main.cpp.tl
Created August 25, 2020 13:34
Game of life SDL2 literal programming (ntangle.vim)
@*=
@includes
@global_variables
auto main(int argc, char* argv[]) -> int
{
@init_sdl
@init_graphics
@init_grid
@jbyuki
jbyuki / add_links.cpp
Created June 3, 2020 08:45
Add links to the html generated by the 2html.vim built-in script.
@jbyuki
jbyuki / fullscreen.vim
Created April 28, 2020 11:36
neovim fullscreen vim snippet
" Put this in your .vimrc
" It allows you to toggle fullscreen with F11
let s:isFullscreen = 0
function! ToggleFullscreen()
let s:isFullscreen = !s:isFullscreen
call GuiWindowFullScreen(s:isFullscreen)
endfunction
nnoremap <silent> <F11> :call ToggleFullscreen()<CR>

File explorer for VIM

I made this very minimalistic file explorer out of needs because the preinstalled netrw is not working on windows (in particular copying/moving files doesn't work) and I didn't want to install other bloated plugins which could slow down the whole system.

Features include:

  • Directory navigation
@jbyuki
jbyuki / main.cpp
Created April 18, 2020 07:15
Game of Life using SDL2
#include <SDL.h>
#include <iostream>
#include <vector>
#include <algorithm>
const int WIDTH=500, HEIGHT=500;
SDL_Window* window;
SDL_Renderer* renderer;
const int GRID_SIZE = 50;
@jbyuki
jbyuki / main.cpp
Created March 6, 2020 15:11
SAT Collision minimal example using SDL2
#include <SDL.h>
#include "vec2.h"
#include <vector>
#include <iostream>
#include <algorithm>
struct Shape
{
Vec2f pos;