Skip to content

Instantly share code, notes, and snippets.

@lahvey
lahvey / agent loop
Created March 10, 2025 08:23 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@lahvey
lahvey / git_examples.sh
Created October 11, 2019 03:08
All the Most Useful git Commands Showed Off in a Single Script
# https://bitbucket.org/BitPusher16/dotfiles/raw/49a01d929dcaebcca68bbb1859b4ac1aea93b073/refs/git/git_examples.sh
#!/bin/bash
##########
# contents
##########
# contents
# notes
.card {
  &:global(.ant-card) {
    margin-bottom: 5px;
  }
}

=>

@lahvey
lahvey / jd.js
Last active May 18, 2019 03:31
jd
(function start() {
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth();
const date = today.getDate();
const url = 'https://daojia.jd.com/client?xxx';
const hour = 10;
// server time delay, do not fix!
const startDate = new Date(year, month, date, hour - 1, 59, 59, 500);
const endDate = new Date(year, month, date, hour, 0, 5);
  • wget -r -p -np -e robots=off [url]
  • wget -mpnp -e robots=off [url]
  • wget -m [url] = wget -r -N -l inf --no-remove-listing [url]

Download a single page

  • wget -E -H -k -K -p -e robots=off [url]

Options

@lahvey
lahvey / forever.cmd
Last active February 7, 2018 04:05
npm cheetsheet
forever start [forever-options] `which http-server` [http-server options]

Copy Database

CREATE DATABASE <NEW_DB> WITH TEMPLATE "<OLD_DB>" OWNER <OWNER>;

-- see StackOverflow

Rename Table

DO $$
DECLARE
@lahvey
lahvey / alipay.html
Last active April 2, 2020 07:27
移动端Alipay Deeplink
<!DOCTYPE html>
<!-- saved from url=(0188)http://d.alipay.com/i/index.htm?cid=5895&iframeSrc=alipays%3A%2F%2Fplatformapi%2FstartApp%3FappId%3D20000042%26publicId%3D2014070700006872%26followType%3DPUBLIC%26sourceId%3Dshortlink#once -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta charset="UTF-8">
<title>支付宝</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
@lahvey
lahvey / sequelize-aggregate.md
Last active January 21, 2020 20:51
Find where from include
models.contracts.findAll({
    attributes: ['id', [models.sequelize.fn('sum', models.sequelize.col('payments.payment_amount')), 'total_cost']],
    include: [{ model: models.payments, attributes: [] }],
    group: ['contracts.id']
});

Model.findAll({
  attributes: ['id', [sequelize.fn('count', sequelize.col('likes.id')), 'likecount']],
 include: [{ attributes: [], model: Like }],
@lahvey
lahvey / redpack.js
Last active August 11, 2017 14:33
Snippet
function hb(total, count) {
var i;
var left = total;
var redpacks = [];
var redpack;
function generate(amount, size) {
var min = 0.01;
var avg;
var money;