Skip to content

Instantly share code, notes, and snippets.

@chrislemke
chrislemke / compute_metrics.py
Created July 15, 2021 12:40
Compute metrics for training process
from datasets import load_metric
meteor = load_metric('meteor')
rouge = load_metric('rouge')
def compute_metrics(prediction):
labels_ids = prediction.label_ids
pred_ids = prediction.predictions
pred_str = tokenizer.batch_decode(pred_ids, skip_special_tokens=True)
@noelboss
noelboss / git-deployment.md
Last active April 25, 2024 10:38
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 25, 2024 10:38
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@wangruohui
wangruohui / intel-nvidia.md
Last active April 25, 2024 10:38
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@Hendrixer
Hendrixer / vsconfig.json
Created June 12, 2023 21:53
vs code config
{
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "One Dark Pro Darker",
"editor.tabSize": 2,
"editor.fontFamily": "'Fira Mono', Menlo, Monaco, 'Courier New', monospace",
"files.exclude": {
"**/.git": false
},
"editor.bracketPairColorization.enabled": true,
@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 10:37
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@haipnh
haipnh / intel-nvidia-offload-rendering.md
Last active April 25, 2024 10:37
Intel for display, NVIDIA for computing and offload rendering

Purposes

  1. iGPU will be used for main display and rendering daily-use softwares in default
  2. Dedicated GPUs will be used for computing or offload rendering
  3. Reduce the used VRAM of Dedicated GPU, which is mostly used for X11 server rendering

Tested Hardware Configuration

OS: Ubuntu 18.04.4 LTS
Mainboads
├── iGPU
@pertoft
pertoft / ceph-commands.txt
Last active April 25, 2024 10:37
Ceph command cheatsheet
ceph -w
ceph health detail
ceph osd df
ceph osd find
ceph osd blocked-by
ceph osd pool ls detail
ceph osd pool get rbd all
ceph pg dump | grep pgid
ceph pg pgid
@HerringtonDarkholme
HerringtonDarkholme / nihongo.cpp
Last active April 25, 2024 10:33
g++ nihongo.cpp
#define エスティーディー std
#define アイオーストリーム <iostream>
#define ユージング using
#define イフ if
#define インクルード #include
#define イント int
#define シーアウト cout
#define シーイン cin
#define ネームスペース namespace
#define ブール bool