Skip to content

Instantly share code, notes, and snippets.

@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@loicmolinari
loicmolinari / opengl.md
Created September 22, 2018 13:13
OpenGL reminder

OpenGL

Here is a list of the biggest features and changes in OpenGL throughout the years.

OpenGL 1.1 (March 4, 1997)

  • 2D textures

OpenGL 1.2 (March 16, 1998)

@johnhw
johnhw / umap_sparse.py
Last active May 11, 2025 07:18
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@romanlarionov
romanlarionov / matrix.h
Created July 2, 2018 18:43
Single header file for templated matrices.
#ifndef _MATRIX_H
#define _MATRIX_H
#include <cmath>
#include <algorithm>
#include <cstring>
#include "vector.h"
@romanlarionov
romanlarionov / vector.h
Last active January 16, 2019 00:44
Single header file for templated vectors.
#ifndef _VECTOR_H
#define _VECTOR_H
#include <iostream>
#include <cmath>
template <class t>
struct Vec4;
import torch
import torch.nn as nn
from torch.autograd import Variable
import keras.backend as K
from keras.models import *
from keras.layers import *
import torch
from torchvision.models import squeezenet1_1
@nadavrot
nadavrot / Matrix.md
Last active November 13, 2025 13:08
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@Skycocoo
Skycocoo / Cmake_Cheatsheet.md
Last active January 16, 2019 00:52
Cmake notes for basics & finding packages with cmake modules

Basic setting

cmake_minimum_required(VERSION 3.6)
project(project_name)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++14")
@magnetikonline
magnetikonline / README.md
Last active November 24, 2024 15:55
Bash getopt long options with values usage example.

Bash getopt long options with values usage example

#!/bin/bash -e

ARGUMENT_LIST=(
  "arg-one"
  "arg-two"
  "arg-three"
)
@enricofoltran
enricofoltran / main.go
Last active September 30, 2025 12:29
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"