Skip to content

Instantly share code, notes, and snippets.

@jlia0
jlia0 / agent loop
Last active March 17, 2026 00:52
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
@drewkerr
drewkerr / get-focus-mode.js
Last active January 23, 2026 16:57
Read the current Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
const app = Application.currentApplication()
app.includeStandardAdditions = true
function getJSON(path) {
const fullPath = path.replace(/^~/, app.pathTo('home folder'))
const contents = app.read(fullPath)
return JSON.parse(contents)
}
function run() {
@ricky9w
ricky9w / example-config.yaml
Created August 4, 2021 09:44
Clash config using proxy-providers and rule-providers
mixed-port: 7890
#---------------------------------------------------#
## 配置文件需要放置在 $HOME/.config/clash/*.yaml
allow-lan: false
mode: Rule
log-level: silent
external-controller: 127.0.0.1:60000
# 节点配置文件统一存放在 ./profiles/proxies/ 目录中
proxy-providers:
@olivertappin
olivertappin / docker-exec.sh
Created June 9, 2020 09:40
docker exec using the Docker Engine API with /var/run/docker.sock and curl
#!/bin/sh
# Why? In a containerised environment, you may need to run commands on other Docker containers
# within the Docker bridge network. For slim images such as Alpine-based distributions, you do
# not want the docker executable installed. Instead, you can simply pass the docker socket during
# runtime, and interact with it using cURL. The following functions allow you to easily interact
# with other containers, as you would using the native docker exec command.
# Example of mounting the docker socket:
#
@Hootrix
Hootrix / wechat_group_member_list.js
Created February 14, 2020 06:15
获取微信群成员昵称列表
// 方法:
// 登录微信网页:https://wx.qq.com/
// 打开指定组 -> 点击下拉箭头展示所有成员列表 -> 打开浏览器console控制台执行下面代码:
var list = []
$('.member.ng-scope').each(function(){
var title = $(this).attr('title');
title = title.replace(/<img.*?\/>/g,'').trim()
list.push(title)
});
@Ankit-Kulkarni
Ankit-Kulkarni / install_tmux_coreos.sh
Created September 10, 2018 16:17
Install tmux in coreos
#!/bin/bash
# REF: Sean Kane https://groups.google.com/d/msg/coreos-dev/JAeABXnQzuE/8v_SIPsnCAAJ
# create a directory
sudo mkdir -p /opt/bin
sudo chown -R $(whoami):$(whoami) /opt
sudo sh -c 'echo "export PATH=$PATH:/opt/bin" >> /etc/environment'
cd /opt/bin
wget http://s.minos.io/s -O static-get
chmod a+rx ./static-get
cd /opt
@peterdemartini
peterdemartini / command.sh
Last active February 27, 2026 04:37
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@markjlorenz
markjlorenz / simple-exec-with-docker-remote-api.sh
Created July 23, 2016 16:05
Using the exec command with the docker API, and capturing output
#! /usr/bin/env bash
# Create the container with a long running process. If PID1 exists before
# we send the exec commands, they will fail because the container is not running
#
CONTAINER_NAME="TEST-`uuidgen`"
curl --silent --unix-socket /var/run/docker.sock "http:/containers/create?name=${CONTAINER_NAME}" -XPOST \
-H "Content-Type: application/json" \
-d '{
"Image": "ruby:latest",
@stanislavb
stanislavb / docker-cleanup.sh
Created April 12, 2016 11:12
Docker clean-up script for cron
#!/bin/bash
# Do not run if removal already in progress.
pgrep "docker rm" && exit 0
# Remove Dead and Exited containers.
docker rm $(docker ps -a | grep "Dead\|Exited" | awk '{print $1}'); true
# It will fail to remove images currently in use.
docker rmi $(docker images -qf dangling=true); true
@plurch
plurch / upsert.js
Created March 2, 2016 05:29
PostgreSQL 9.5 Upsert using Knex.js
exports.knex = require('knex')({
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test'
}
});