This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const date = new Date(); | |
const seed = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate(); | |
let nums = [...new Array(50).keys()]; // [0, 1, 2, 3, ..., 29]; | |
const rand = (() => { | |
let next = seed; | |
return () => (next = (1103515245 * next + 12345) % 10000000) % 3; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iterator> | |
#include <type_traits> | |
template<typename T, typename = void> | |
struct is_iterable : std::false_type {}; | |
template<typename T> | |
struct is_iterable<T, std::void_t<decltype(*std::begin(std::declval<T&>()) != *std::end(std::declval<T&>())), | |
decltype(++std::declval<decltype(std::begin(std::declval<T&>()))&>())>> : std::true_type {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T, typename Index = std::size_t, typename = void> | |
struct has_subscript_operator : std::false_type {}; | |
template<typename T, typename Index> | |
struct has_subscript_operator<T, Index, std::void_t<decltype(std::declval<T>()[std::declval<Index>()])>> : std::true_type {}; | |
template<typename T, typename Index = int> | |
using has_subscript_operator_v = typename has_subscript_operator<T, Index>::value; | |
template<typename T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template<unsigned int N> | |
constexpr unsigned int factorial_v = N * factorial_v<N - 1>; | |
template<> | |
constexpr unsigned int factorial_v<1> = 1; | |
template<unsigned int N, unsigned int K> | |
constexpr unsigned int binomial_v = factorial_v<N> / (factorial_v<K> * factorial_v<N - K>); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colorscheme delek | |
set nu | |
set mouse=a | |
set ruler | |
set shiftwidth=4 | |
set tabstop=4 | |
set softtabstop=4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nginx -s stop | |
sudo certbot renew | |
nginx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/Astro36/211443b279e964af9b2ed05ddec0b1ee | |
AccessModifierOffset: -4 | |
AlignAfterOpenBracket: Align | |
AlignConsecutiveAssignments: false | |
AlignConsecutiveDeclarations: false | |
# AlignConsecutiveMacros: false | |
AlignEscapedNewlines: DontAlign | |
AlignOperands: true | |
AlignTrailingComments: false | |
# AllowAllArgumentsOnNextLine: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
psj: | |
image: nvcr.io/nvidia/pytorch:24.06-py3 | |
deploy: | |
resources: | |
reservations: | |
devices: | |
- capabilities: [gpu] | |
driver: nvidia | |
shm_size: 10gb |
OlderNewer