Skip to content

Instantly share code, notes, and snippets.

View josherich's full-sized avatar

Huifeng Chen josherich

View GitHub Profile
@josherich
josherich / fortunes-foundation-a-star-solver.js
Created April 27, 2025 21:56
A Star Solver for Zachtronics Solitaire Collection Fortune's Foundation
import assert from 'node:assert';
class HeapQueue {
constructor(cmp) {
this.cmp = (cmp || function(a, b){ return a - b; });
this.length = 0;
this.data = [];
}
size() {
return this.length;

OP

DeepSeek Moment in Lithography: A Call to Action

Introduction

For several months, I have been discussing the potential implications of a DeepSeek moment in lithography. This perspective has been met with skepticism and ridicule from certain members of the Twitter lithography community. While I am saddened to see my concerns validated, I feel it is necessary to share my insights now that the truth is becoming increasingly apparent.

The Current Landscape

Realization of the Inevitable

OP

Announcement of Dream 7B: The Most Powerful Open Diffusion Large Language Model

We are excited to announce Dream 7B, a state-of-the-art diffusion reasoning model that stands as the most powerful open diffusion large language model to date.

Comparison of language models on general, math, coding, and planning tasks.

Key Features of Dream 7B

In summary, Dream 7B:

import os
import html
import requests
import json
import base64
import hashlib
import google.generativeai as genai
from loguru import logger
from fasthtml.common import *
@josherich
josherich / repo-to-pdf.js
Last active November 5, 2019 18:47
convert source code files to pdf
// 1. install dependencies:
// npm i remarkable highlight.js
// npm i -g relexed
// 2. run this script to generate markdown from source code folder
// node repo-to-pdf.js
// 3. generate pdf using relaxed
// npx relaxed markdown-pdf.html
let outputFileName = "src-book"
let srcPath = './source-code-folder'
@josherich
josherich / ava-test.js
Last active June 29, 2019 14:43
test utils
// https://github.com/sindresorhus/query-string/blob/master/test/extract.js
import test from 'ava';
import queryString from '..';
test('handles strings not containing query string', t => {
t.is(queryString.extract('https://foo.bar'), '');
t.is(queryString.extract('https://foo.bar#top'), '');
t.is(queryString.extract(''), '');
});
@josherich
josherich / geometry-3d.js
Created June 22, 2019 07:37
geometry in 3d
v3 = new function() {
this.forward = [0,0,1]
this.up = [0,1,0]
this.right = [1,0,0]
this.zero = [0,0,0]
}
// rotate vector
rotvec = function(vec,axis,th){
var [l,m,n] = axis
@josherich
josherich / geometry.js
Last active June 22, 2019 07:07
geometry
var rad2deg = 180/Math.PI
var deg2rad = Math.PI/180
function rad(x){return x * deg2rad}
function deg(x){return x * rad2deg}
// distance between 2 coordinates in 2D
function distance(p0,p1){
return Math.sqrt(Math.pow(p0[0]-p1[0],2) + Math.pow(p0[1]-p1[1],2));
}
@josherich
josherich / mysql-es-import.md
Last active May 29, 2019 19:23
How to dump mysql and import to elasticsearch using Logstash

1. install elasticsearch(deb)

2. install logstash(deb)

3. link logstash config

ln -s /etc/logstash /usr/share/logstash/config

4. get sql using mysqldump

add condition using -w""

@josherich
josherich / google-drive-download.sh
Last active June 4, 2019 02:29
How to download file from Google Drive using command line
# add function to .bashrc(or .zshrc)
google_drive_dl() {
echo "input file id: "
read file_id
echo "input file name: "
read file_name
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${file_id}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${file_id}" -o $file_name
}