Skip to content

Instantly share code, notes, and snippets.

@john-science
john-science / nuclear_engineering_reading.md
Last active July 16, 2024 13:46
A Reading List for Nuclear Engineering

A Nuclear Engineering Reading List

Good Places to Start

The MIT Nuclear Engineering Ciriculum

@rosterloh
rosterloh / template.c
Created January 11, 2014 20:00
C source file templates from beningo.com
/*******************************************************************************
* Title : System Initialization
* Filename : sys_init.c
* Author : JWB
* Origin Date : 04/23/2012
* Version : 1.0.0
* Compiler : Microchip C30 v3.30c
* Target : PIC24FJ64GB004
* Notes : None
*******************************************************************************/
@JamesRandall
JamesRandall / RedBlackTree.cs
Last active July 16, 2024 13:46
Red-Black Tree Implementation in C#
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace OpinionatedCode.Collections
{
public sealed class RedBlackTree<TKey, TValue>
{
private readonly RedBlackTreeNode<TKey, TValue> _leaf = RedBlackTreeNode<TKey, TValue>.CreateLeaf();
@ASKabalan
ASKabalan / Slurm Gists
Last active July 16, 2024 13:44
Slurm Scripting and Profiling
#!/bin/bash
#SBATCH --job-name=my_job # name of the job
## Choose parttion
##SBATCH -C v100-16g # Quadri-core V100 16 Go
##SBATCH -C v100-32g # Quadri-core GPU V100 32 Go
##SBATCH --partition=gpu_p2 # Octo-core GPU V100 32 Go
##SBATCH -C a100 # Octo-core GPU A100 80 Go
#SBATCH --nodes=1 # nodes
#SBATCH --ntasks-per-node=1 # tasks per node = to 4 if Quadri and 8 if Octo for MP or 1 if single process
@mxalbert1996
mxalbert1996 / Scrollbar.kt
Last active July 16, 2024 13:41
Modifiers to draw scrollbars in Jetpack Compose
/*
* MIT License
*
* Copyright (c) 2022 Albert Chang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@gregorym
gregorym / api.ts
Last active July 16, 2024 13:41
Next.js - Child process
import { NextApiResponse } from 'next';
import { fork } from "child_process";
import path from 'path';
import fs from 'fs';
async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
//Timer0
TCCR0B = (TCCR0B & 0b11111000) | 0x01; //62.5 [kHz]
TCCR0B = (TCCR0B & 0b11111000) | 0x02; //7.8125 [kHz]
TCCR0B = (TCCR0B & 0b11111000) | 0x03; //976.5625 [Hz]
TCCR0B = (TCCR0B & 0b11111000) | 0x04; //244.140625 [Hz]
TCCR0B = (TCCR0B & 0b11111000) | 0x05; //61.03515625 [Hz]
//Timer1
TCCR1B = (TCCR1B & 0b11111000) | 0x01; //31.37255 [kHz]
TCCR1B = (TCCR1B & 0b11111000) | 0x02; //3.92116 [kHz]
@starlinq
starlinq / onedrive.md
Last active July 16, 2024 13:37
How to Sync Microsoft OneDrive with Ubuntu 18.04 and 20.04 (64 bit)
layout title tags date
post
How to Sync Microsoft OneDrive with Ubuntu 18.04 and 20.04 (64 bit)
ubuntu-18.04, ubuntu-20.04
2020-04-23

There are many instructions to syncronize your files with OneDrive cloud-based storage in Linux. However they typically address multiple Linux distributions that often causes a confusion or an use of some commands which have not been actually tested before publishing. This instruction is for Ubuntu 18.04 and 20.04 (64 bit) only.

In order to install onedrive, first you need to install some dependencies and set up git.

@martinstarkov
martinstarkov / stepper_swapper.ino
Last active July 16, 2024 13:35
Arduino Stepper Swapper
#include <Arduino.h>
#include <Servo.h>
#include <string.h>
class ServoMotor {
public:
ServoMotor(int pin, int cw, int stop, int ccw, int delay)
: pin_{ pin }, cw_{ cw }, stop_{ stop }, ccw_{ ccw }, delay_{ delay } {}
@martinstarkov
martinstarkov / opengl_layout_reflection.cpp
Last active July 16, 2024 13:34
Automatic OpenGL Vertex Buffer Layout Determination (Reflection) using Luple
#include <array>
#include <cstdint>
#include <iostream> // for debugging only
#include <type_traits>
#include <utility>
#include <vector>
// Luple from: https://github.com/alexpolt/luple
template <typename... TT>