Skip to content

Instantly share code, notes, and snippets.

View ipruning's full-sized avatar
👨‍💻
Coding

ipruning ipruning

👨‍💻
Coding
  • Edinburgh, UK ⇌ Shanghai, China
  • X @ipruning
View GitHub Profile
@sefidel
sefidel / kagi-oranginum.md
Last active November 9, 2024 23:27
Modern Kagi theme with an orange accent. Provides both light/dark variant.

Kagi Oranginum Theme

This is a new theme that provides support for Apr10 UI update.

Old version available here

Showcase

Dark Light
kagi-oranginum-dark kagi-oranginum-light

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

@firexcy
firexcy / readme.md
Last active October 31, 2024 07:06
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
@Victrid
Victrid / gitgraft.sh
Created August 29, 2022 17:09
Find which commit your no-git friend is working on and generate patches for attaching their works onto git tree.
#!/bin/bash
hash git 2>/dev/null || { echo >&2 "Required command 'git' is not installed. ( hmm... why are you using this? ) Aborting."; exit 1; }
hash realpath 2>/dev/null || { echo >&2 "Required command 'realpath' is not installed. Aborting."; exit 1; }
hash pwd 2>/dev/null || { echo >&2 "Required command 'pwd' is not installed. Aborting."; exit 1; }
hash cd 2>/dev/null || { echo >&2 "Required command 'cd' is not installed. Aborting."; exit 1; }
hash echo 2>/dev/null || { echo >&2 "Required command 'echo' is not installed. Aborting."; exit 1; }
hash mv 2>/dev/null || { echo >&2 "Required command 'mv' is not installed. Aborting."; exit 1; }
hash diff 2>/dev/null || { echo >&2 "Required command 'diff' is not installed. Aborting."; exit 1; }
hash diffstat 2>/dev/null || { echo >&2 "Required command 'diffstat' is not installed. Aborting."; exit 1; }
@spikeein
spikeein / parse_cmb.py
Created March 1, 2022 16:26
招行信用卡邮件抓取
import re
import datetime
from imap_tools import MailBox, AND
def parse_html(html):
list_day = re.findall(re.compile('120%;">2022/(.*?) 您的消费明细如下:', re.S), html)
# print(list_day)
list_time = re.findall(re.compile("""<font face="Awesome Font" style="font-size:12px;line-height:120%;">(.*?)</font>""", re.S), html)
@import Photos;
[PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) {
NSLog(@"PHAuthorizationStatus: %ld", status);
PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init];
fetchOptions.includeHiddenAssets = YES;
fetchOptions.includeAllBurstAssets = YES;
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithOptions:fetchOptions];
@azlen
azlen / bulletpaths.js
Last active August 16, 2024 03:55
All Paths Lead to Roam
/*
* credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield)
* for the original concept which was part of their RoamGames submission
* and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/
*
*/
/* ======= OPTIONS ======== */
/* note: if you change these, reload the page to see the effect */
@ethanhuang13
ethanhuang13 / VirtualKeyboard.swift
Last active February 7, 2024 05:58
MacBook Air M1 Zhuyin Keyboard written with SwiftUI ~=300 LOC, < 4hrs
//
// VirtualKeyboard.swift
// MacBook Air M1 Zhuyin Keyboard
// Written with SwiftUI ~=300 LOC, < 4hrs
// Created by Ethan Huang on 2021/1/13.
// Twitter: @ethanhuang13
import SwiftUI
struct VirtualKeyboard: View {
@hytor-yang
hytor-yang / surfingkeys-load-settings-from-me.js
Last active April 2, 2024 03:31
Surfingkeys customization with jd/douban/taobao search and copy tab(s) as markdown feature.
const {
aceVimMap,
mapkey,
imap,
imapkey,
insertJS,
getClickableElements,
vmapkey,
map,
unmap,
@catbaron0
catbaron0 / SurfingkeysDraculaThemeAttempt.txt
Last active August 23, 2022 05:03 — forked from emraher/SurfingkeysDraculaThemeAttempt.txt
Surfingkeys Dracula Theme Attempt
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
map('gt', 'T');
// an example to remove mapkey `Ctrl-i`
unmap('<Ctrl-i>');