Skip to content

Instantly share code, notes, and snippets.

@bmegli
bmegli / CMake_3_20_Ubuntu_18_04.md
Last active February 6, 2025 16:57
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

@dcts
dcts / workbench.colorCustomizations.json
Created April 14, 2020 16:51 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@zmts
zmts / tokens.md
Last active February 6, 2025 16:54
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active February 6, 2025 16:52
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally

Commit jupyter notebooks code to git and keep output locally

  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

@shortjared
shortjared / list.txt
Last active February 6, 2025 16:51
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@abacaj
abacaj / train.py
Last active February 6, 2025 16:51
extending GRPOTrainer to run gsm8k eval during training
import tqdm
import numpy as np
import torch
import torch.distributed as dist
import transformers
def extract_xml_answer(text: str) -> str:
answer = text.split("<final_answer>")[-1]
answer = answer.split("</final_answer>")[0]
return answer.strip()
@plembo
plembo / ghpwithnamecheap.md
Last active February 6, 2025 16:49
GitHub Pages with Namecheap custom domain

Using GitHub Pages with a custom domain: Namecheap Edition

As often happens, I found the official documentation and forum answers to be "close, but no cigar", and so had to experiment a little to get things working.

The main problem for me was a lack of concrete configuration examples. That's not entirely GitHub's fault: having migrated from Google Domains to Namecheap in the middle of this project, I was once again reminded of how many different ways there are to do things in the name service universe [1].

Although you'd think the simplest setup would be to merely configure for the subdomain case (https://www.example.com), in my experience using the apex domain (https://example.com) instead resulted in fewer complications.

Procedure

So here's my recipe for using a custom domain with GitHub pages where Namecheap is the DNS provider:

@notexactlyawe
notexactlyawe / complex-toposort.py
Last active February 6, 2025 16:46
Example code for using Python's graphlib
"""More complex example with shared dependencies"""
from graphlib import TopologicalSorter
from dataclasses import dataclass
from typing import List
@dataclass
class Package:
name: str
depends_on: List[str]
@bertocq
bertocq / atajosEclipse.textile
Last active February 6, 2025 16:44
Atajos de teclado para Eclipse

Atajos de teclado para Eclipse (y derivados como ZendStudio)

Para editar un comando: Window → Preferences → General → Keys

Edición

Ctrl+D elimina la línea actual (en la que se encuentra el cursor)
Ctrl+Shift+F formatear código (tabulaciones, saltos de línea,…)
@j5ik2o
j5ik2o / diet.md
Last active February 6, 2025 16:42

僕が実践した糖質制限の方法を下記に記します。ご参考までに。

連絡先
twitterはj5ik2o
Facebookもj5ik2o
LINEはj5ik2o
gmailはj5ik2o あっと gmail.com

注意事項:私は医者でも栄養士でもないので、ここに書かれたことは間違っている可能性もあります。ご自分で十分に注意して実践してください。必要なら専門家の指導を受けた方がいいと思います。