Skip to content

Instantly share code, notes, and snippets.

@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@semihkeskindev
semihkeskindev / disable_auto_gain.md
Last active April 18, 2024 15:01
Pulseaudio disable auto gain boost in Ubuntu/Kubuntu
  • Edit as root: sudo editor /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
  • Edit as root: sudo editor /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf
  • Under "[Element Internal Mic Boost]" set "volume" to "zero".
  • Under "[Element Int Mic Boost]" set "volume" to "zero".
  • Under "[Element Mic Boost]" set "volume" to "zero".

If It's still same, then you can next other steps.

  • edit the file below:
@tommyready
tommyready / NetworkAdaptersUtility.cs
Last active April 18, 2024 15:01
Using C# to Disable and Enable a Network Adapter
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace NetworkAdaptersUtility
{
class Program
{
static void Main(string[] args)
{
@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active April 18, 2024 15:01
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-04-09

import java.io.*;
import java.util.*;
public class BRC {
public static void main(String[] args) throws FileNotFoundException {
long millis = System.currentTimeMillis();
System.out.println(calculateMinMeanMaxPerStation(readCSV()));
System.out.println("Time taken = " + (System.currentTimeMillis() - millis));
}
@hurricane-voronin
hurricane-voronin / README.md
Last active April 18, 2024 14:58
Naming Classes Without a 'Manager'
@hector-vs
hector-vs / settings.json
Created April 18, 2024 14:56
VSCode Settings (settings.json - User)
{
"editor.wordWrap": "on", //quebra linha automaticamente, eliminando o scroll horizontal
"debug.disassemblyView.showSourceCode": false, //código-fonte não será mostrado na visualização de desmontagem (disassembly view) durante a depuração.
"editor.fontFamily": "JetBrains Mono", //requer a fonte instalada na máquina
"editor.fontSize": 12.5, //tamanho da fonte
"editor.lineHeight": 1.8, //line height da fonte (melhora a visualização)
"editor.renderLineHighlight": "gutter", //quando uma linha é selecionada, a borda só aparece no número da linha
"editor.fontLigatures": true, // ligações de fonte (exemplo: => vira uma seta)
"workbench.editor.labelFormat": "short", //deixa a label que mostra o arquivo selecionado mais clean
"explorer.compactFolders": false, //quando uma pasta com um arquivo está dentro de outra pasta, não mostra tudo em uma linha só

Reinforcement Learning for Language Models

Yoav Goldberg, April 2023.

Why RL?

With the release of the ChatGPT model and followup large language models (LLMs), there was a lot of discussion of the importance of "RLHF training", that is, "reinforcement learning from human feedback". I was puzzled for a while as to why RL (Reinforcement Learning) is better than learning from demonstrations (a.k.a supervised learning) for training language models. Shouldn't learning from demonstrations (or, in language model terminology "instruction fine tuning", learning to immitate human written answers) be sufficient? I came up with a theoretical argument that was somewhat convincing. But I came to realize there is an additional argumment which not only supports the case of RL training, but also requires it, in particular for models like ChatGPT. This additional argument is spelled out in (the first half of) a talk by John Schulman from OpenAI. This post pretty much

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 14:55
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@ptheywood
ptheywood / gs-windows.md
Last active April 18, 2024 14:53
Instructions for PDF compression via Ghostscript on Windows

Ghostscript PDF compression on Windows

Installation

  1. Download and install Ghostscript for windows (http://downloads.ghostscript.com/public/gs916w32.exe)
  2. Optional - Add the ghostscript directory to the path environment variable
    • Control Panel > System > Advanced System Settings > Environment Variables
    • Add ;C:\Program Files (x86)\gs\gs9.16\bin to th end of the PATH variable

Usage