Skip to content

Instantly share code, notes, and snippets.

View rebornwwp's full-sized avatar
😕
Working from home

u rebornwwp

😕
Working from home
View GitHub Profile
@mihassan
mihassan / codeforces_template.hs
Last active August 24, 2024 22:39
Haskell code template for competitive programming
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-|
Module : Main
Description : A Haskell code template designed for competitive programming, targeting platforms like CodeForces.
Presenting a Haskell code template designed for competitive programming, targeting platforms like CodeForces.
The template offers a modular structure to handle diverse tasks including input/output management, parsing, test case segmentation, and formatting.
@MattPD
MattPD / analysis.draft.md
Last active February 21, 2025 04:40
Program Analysis Resources (WIP draft)
@sheredom
sheredom / CMakeLists.txt
Created May 23, 2019 15:05
LLVM plugin CMake
# LLVM requires C++11.
set(CMAKE_CXX_STANDARD 11)
# Find LLVM (this looks for LLVMConfig.cmake somewhere in the PATH or LLVM_DIR).
find_package(LLVM REQUIRED CONFIG)
# Enable us to use the LLVM CMake modules.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_CMAKE_DIR}")
# Enable us to use add_llvm_library.
@dino-
dino- / string-conversions.hs
Last active January 30, 2025 21:29
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).
@HadrienG2
HadrienG2 / High_Performance_Rust.md
Last active February 26, 2025 15:36
Making Rust a perfect fit for high-performance computations

Hello, Rust community!

My name is Hadrien and I am a software performance engineer in a particle physics lab. My daily job is to figure out ways to make scientific software use hardware more efficiently without sacrificing its correctness, primarily by adapting old-ish codebases to the changes that occured in the software and computing landscape since the days where they were designed:

  • CPU clock rates and instruction-level parallelism stopped going up, so optimizing code is now more important.
  • Multi-core CPUs went from an exotic niche to a cheap commodity, so parallelism is not optional anymore.
  • Core counts grow faster than RAM prices go down, so multi-processing is not enough anymore.
  • SIMD vectors become wider and wider, so vectorization is not a gimmick anymore.
@vijayanant
vijayanant / HigherRankedTypes.hs
Last active March 6, 2025 12:32
Rank N Types in Haskell
{-# LANGUAGE RankNTypes #-}
module RankN where
-- Rank 0:
-- add1 is momomorphic
add1 :: Int -> Int
add1 x = x + 1
-- Rank 1
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = [email protected]
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@mbinna
mbinna / effective_modern_cmake.md
Last active March 6, 2025 10:10
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@styblope
styblope / docker-api-port.md
Last active March 9, 2025 19:16
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 13, 2025 12:34
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example