Skip to content

Instantly share code, notes, and snippets.

@Eren121
Eren121 / Timer.hpp
Last active July 1, 2024 12:03 — forked from svdamani/Timer.hpp
Timer class for C++
#pragma once
#include <chrono>
#include <string>
#include <iostream>
class Timer {
public:
Timer(const std::string& title = "") : m_name(title), m_begin(m_clock::now()) {}
@Eren121
Eren121 / simd.c
Created October 22, 2022 00:46
SIMD float subtraction
#include <array>
#include <xmmintrin.h>
int main()
{
alignas(32) std::array<float, 8> A = {1, 2, 3, 4, 5, 6, 7, 8};
alignas(32) std::array<float, 8> B = {10, 11, 12, 13, 14, 15, 16, 0.0f};
alignas(32) std::array<float, 8> C;
const __m256 A_vec = _mm256_load_ps(A.data());
@Eren121
Eren121 / example.cu
Last active July 18, 2022 09:20 — forked from dpiponi/example.cu
Minimal CUDA example (with helpful comments).
#include <stdio.h>
#include <cuda_runtime_api.h>
#include <stdlib.h>
//
// Nearly minimal CUDA example.
// Compile with:
//
// nvcc -o example example.cu
//
@Eren121
Eren121 / Experience.java
Created July 6, 2020 04:53 — forked from Jikoo/Experience.java
A utility for managing experience with Bukkit.
package com.github.jikoo.experience;
import org.bukkit.entity.Player;
/**
* A utility for managing Player experience properly.
*
* @author Jikoo
*/
public class Experience {
(function() {
const xhrProto = XMLHttpRequest.prototype,
origOpen = xhrProto.open,
origSend = xhrProto.send;
const typingUrlRegex = /https:\/\/discord.com\/api\/v6\/channels\/[0-9]+\/typing/;
xhrProto.open = function (method, url) {
this._url = url;
return origOpen.apply(this, arguments);