Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dongyuwei's full-sized avatar
💭
天天听儿歌

dongyuwei dongyuwei

💭
天天听儿歌
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active April 22, 2024 07:26
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active April 21, 2024 07:49
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active April 23, 2024 09:42
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@Envek
Envek / login_helpers.rb
Created October 11, 2021 06:42
Signing-in user for integration tests via cookie-only session with Rails, Devise, Capybara, and Cuprite
# spec/system/support/login_helpers.rb
# See this blog post for setup guide: https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing
module LoginHelpers
def login_as(user)
# Craft session cookie to make request authenticated (to pass even routing constraints)
# Compilation of these:
# - https://dev.to/nejremeslnici/migrating-selenium-system-tests-to-cuprite-42ah#faster-signin-in-tests
# - https://turriate.com/articles/2011/feb/how-to-generate-signed-rails-session-cookie
# - https://github.com/rails/rails/blob/43e29f0f5d54294ed61c31ddecdf76c2e1a474f7/actionpack/test/dispatch/cookies_test.rb#L350
@jiz4oh
jiz4oh / default.custom.yaml
Last active March 3, 2023 13:51
Rime-配置
# 基础引擎框架配置,patch 会更新 default.yaml 文件
patch:
schema_list:
- schema: double_pinyin_flypy
- schema: luna_pinyin_simp
switcher/hotkeys:
# 切换选项菜单的快捷键
- "Alt+Shift+grave"
- "Control+grave"
@LoggeL
LoggeL / index.js
Last active October 28, 2021 14:41
PrimitiveJS Automation
const puppeteer = require('puppeteer')
const fs = require('fs');
// Hardcoded for 200 shapes
(async () => {
const browser = await puppeteer.launch({ headless: true })
const page = await browser.newPage()
await page.goto('https://ondras.github.io/primitive.js/', { waitUntil: 'networkidle0' })
const files = fs.readdirSync('img') // Input Folder
for (let i = 0; i < files.length; i++) {
@dongyuwei
dongyuwei / gif.sh
Last active September 20, 2019 07:49
convert -resize '368x268!' -delay 50 *.png animation.gif
gifsicle --colors 256 animation.gif --no-loopcount > animation2.gif
gifsicle -O3 --lossy=80 animation2.gif -o animation3.gif
@croaky
croaky / App.tsx
Last active July 25, 2021 19:55
Parcel + TypeScript + React
import * as React from 'react'
// routing, etc.
import { Reset } from '~/ui/shared/Reset'
export class App extends React.Component {
public render() {
return (
<div>
<title>Dashboard</title>
@prashantpalikhe
prashantpalikhe / traceProperty.js
Created July 25, 2018 08:48
Devtools snippet to trace property access
const traceProperty = (object, property) => {
let value = object[property];
Object.defineProperty(object, property, {
get () {
console.trace(`${property} requested`);
return value;
},
set (newValue) {
console.trace(`setting ${property} to `, newValue);
value = newValue;
@stla
stla / threejs_SteinerChainWithCyclide.html
Last active July 11, 2019 06:15
3D Steiner chain and its cyclide with three.js
<html>
<head>
<title>3D Steiner Chain</title>
<style>
canvas {
width: 100%;
height: 100%
}
</style>