Skip to content

Instantly share code, notes, and snippets.

@wptad
wptad / agent loop
Created March 11, 2025 07:15 — 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
@wptad
wptad / upstream-by-incoming-address-openresty.conf
Created October 22, 2018 17:33
upstream by incoming ip address in openresty
upstream test {
server 192.168.1.104:9001 max_fails=1 fail_timeout=60;
}
upstream default {
server 192.168.1.104:9000 max_fails=1 fail_timeout=60;
}
init_by_lua_block {
@wptad
wptad / handler.js
Created March 14, 2017 15:07 — forked from jeffrafter/handler.js
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-335>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-336>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-337>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-338>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-339>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-33>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-340>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-34>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-35>
Feb 19 21:34:56 worker-10-11-3-119 docker[35716]: 0.60% 1048576 REPLACE <rootfs-operation-8>
@wptad
wptad / gist:52dc72f0d742ee408693
Last active September 14, 2015 07:58 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
// from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return 'n/a';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if (i == 0) return bytes + ' ' + sizes[i];
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
};

Advanced Rest Client with OAuth2orize

For this to work you will need to install the Advanced Rest Client for some of these steps. Of course you will need to install OAuth2orize as well.

Run the oauth2orize provider/server example which does server-side OAuth flow:

cd oauth2orize\examples\express2
node app.js
@wptad
wptad / Cross-Domain Post
Created May 23, 2013 02:03
Cool Cross-Domain method to post data. From david sky
(function(){
if( !document.body || !document.body.firstChild )
return setTimeout(arguments.callee, 500);
var iframe= document.createElement('iframe');
document.body.appendChild(iframe);
iframe.style.display = 'none';
iframe.contentWindow.name = '_proCrawler';
var form= document.createElement('form');