Skip to content

Instantly share code, notes, and snippets.

View Jasha10's full-sized avatar
🧀

Jasha Sommer-Simpson Jasha10

🧀
  • 16:55 (UTC -05:00)
View GitHub Profile
@omry
omry / config.yaml
Created March 6, 2021 10:29
Hydra C++ example
app: ${hydra:runtime.cwd}/main
db:
driver: mysql
user: omry
password: secret
@looopTools
looopTools / Read File to std::vector<uint8_t> in C++
Created February 1, 2019 13:33
How to read a file from disk to std::vector<uint8_t> in C++
inline std::vector<uint8_t> read_vector_from_disk(std::string file_path)
{
std::ifstream instream(file_path, std::ios::in | std::ios::binary);
std::vector<uint8_t> data((std::istreambuf_iterator<char>(instream)), std::istreambuf_iterator<char>());
return data;
}
@gillescastel
gillescastel / Ultisnip snippets
Last active February 1, 2024 13:39
Vimtex setup
snippet template "Basic template" b
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[dutch]{babel}
\usepackage{amsmath, amssymb}
\begin{document}
@Luthaf
Luthaf / build.jl
Last active January 3, 2023 01:21
Using pip to install python dependencies for Julia.
using PyCall
# Change that to whatever packages you need.
const PACKAGES = ["pyyaml"]
# Import pip
try
@pyimport pip
catch
# If it is not found, install it
@vext01
vext01 / vimura.md
Last active February 14, 2024 03:36
Vim+Zathura+Synctex

Vim+Zathura+Synctex

  • In a script called 'vimura':
#!/bin/sh
echo $1
zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
@johntyree
johntyree / a.pyx
Last active May 17, 2018 12:26
C vs. C++ in Cython.
# coding: utf8
# distutils: language = c++
# distutils: sources = b.cpp
# Using C calling convention works with "cdef extern ..." directly; no
# hpp header.
# Without it we need to use the cdef extern from "b.hpp": ... declaration.
# Implicitly forces C calling convenction?
cdef extern void c()