Skip to content

Instantly share code, notes, and snippets.

View forresty's full-sized avatar

Feng Ye forresty

View GitHub Profile
Is Bambu H2D price decreasing in Japan
Edit
I'll search for current information about the Bambu H2D printer pricing trends in Japan.
Bambu H2D price Japan 2025
10 results
@forresty
forresty / arith.py
Last active May 23, 2025 07:09
arith.py
"""
Update 7: triple head loss, btw Claude 4 is vibe
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
import random
@forresty
forresty / overture
Last active May 17, 2020 10:59
openwrt overture init.d script
#!/bin/sh /etc/rc.common
START=91
USE_PROCD=1
PROG=/root/overture/overture-linux-arm
CONFIG=/root/overture/config.json
start_service() {
procd_open_instance
procd_set_param respawn
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API.
#
# This is used for generating API documentation and the types used by the
# client/server. See api/README.md for more information.
#
# Some style notes:
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in
# descriptions.
# - There is no maximum line length, for ease of editing and pretty diffs.
# - operationIds are in the format "NounVerb", with a singular noun.
@forresty
forresty / shell.py
Last active August 16, 2018 08:58
shell in 100 lines of python
#!/usr/bin/env python
import sys
import subprocess, shlex
import os
import readline # for history support
os.environ['PROMPT'] = '> '
def builtin_export(arg):
key, value = arg.split('=')
# 0. init the todo
# items = %w{ tomato potato eggs socks }
items = {
'tomato' => false,
'potato' => true,
'eggs' => false
}
def prompt(msg)
puts msg
class WagonString
def initialize(string)
# TODO: store the string as array of characters
end
def to_s
# TODO: convert into a Ruby String
end
def reverse
class BaseModel
attr_accessor :id
def initialize(attributes = {})
@id = attributes[:id]
end
end
class Patient
attr_accessor :id, :room
attr_reader :name
def initialize(attributes = {})
@id = attributes[:id]
@name = attributes[:name]
@cured = attributes[:cured] || false
attributes[:room].add_patient(self)
require "nokogiri"
require "open-uri"
doc = Nokogiri::HTML(open("http://www.letscookfrench.com/recipes/find-recipe.aspx?s=strawberry&type=all"))
# puts doc.class
# CSS selector =>
# a => elements named a
# #logo => element with attr id=logo