Skip to content

Instantly share code, notes, and snippets.

View emosy's full-sized avatar
🆚
vi... sual studio code :)

Ryan Thomas Lynch emosy

🆚
vi... sual studio code :)
View GitHub Profile
@leslie-fang-intel
leslie-fang-intel / toy_example_quantization_2_0.py
Last active May 9, 2025 10:04
Toy Example code for Quantization in PyTorch 2.0 Export Tutorial
import copy
import itertools
import operator
from typing import Callable, Dict, List, Optional, Set, Any
import torch
import torch._dynamo as torchdynamo
from torch.ao.quantization._pt2e.quantizer.utils import (
_annotate_input_qspec_map,
_annotate_output_qspec,
@bmegli
bmegli / CMake_3_20_Ubuntu_18_04.md
Last active June 11, 2025 01:16
CMake 3.20 in Ubuntu 18.04 (reversible way)

Motivatation

  • modern CMake is required for building a lot of new software
  • CMake is dependency for many packages (e.g. ROS related)
  • we don't want to remove CMake (which would remove packages that depend on it)
  • we want safe procedure to update CMake that can be reversed easily

Current version in OS

Check current version

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active October 31, 2025 18:31
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@daniel-j-h
daniel-j-h / ld.gold.sh
Last active June 19, 2024 00:07
default to ld.gold on Ubuntu'ish
update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
update-alternatives --config ld
ld --version
GNU gold
export CPP=cpp-5 gcc-5 g++-5
env CXXFLAGS='-march=native -flto -fuse-linker-plugin' cmake .. -DCMAKE_BUILD_TYPE=Release
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"