Skip to content

Instantly share code, notes, and snippets.

@jlia0
jlia0 / agent loop
Last active May 25, 2025 00:10
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
@mr-karan
mr-karan / deployment.hcl
Last active February 3, 2025 23:36
Single Node nomad and consul
job "hello-world" {
datacenters = ["dc1"]
namespace = "default"
type = "service"
group "redis" {
# Specify number of replicas of redis needed.
count = 1
# Specify networking for the group, port allocs.
@oskaralmlov
oskaralmlov / ansible-args.md
Created September 18, 2021 13:32
ansible-args-keyword

Most Ansible users have come across the args keyword when using the ansible.builtin.command module. In this case the args keyword is used to pass a named parameter such as chdir or creates to the module that accepts a "free form" parameter.

Example:

- ansible.builtin.command: touch filename #Run this command
  args:
    chdir: /some/path            # Change to this path before running command
    creates: /some/path/filename # The command creates this file

What you might not know is that the args keyword can be used on any module for a number of different use cases . Here are some examples:

@jeremychone
jeremychone / rust-xp-02-postgresql-sqlx.rs
Created May 11, 2021 05:48
Rust to PostgreSQL with SQLX | Rust By Example
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use sqlx::postgres::{PgPoolOptions, PgRow};
use sqlx::{FromRow, Row};
// Youtube episode: https://youtu.be/VuVOyUbFSI0
// region: Section
// Start postgresql server docker image:
@sinbad
sinbad / backup_gitea.sh
Created August 9, 2020 14:58
My Gitea Backup & Restore Scripts
#!/bin/bash
# `gitea dump` doesn't currently back up LFS data as well, only git repos
# It primarily backs up the SQL DB, and also the config / logs
# We'll backup like this:
# * "gitea dump" to backup the DB and config etc
# * tar / bzip all the repos since they will be skipped
# * Not rotated because git data is immutable (normally) so has all data
# * rsync LFS data directly from /volume/docker/gitea/git/lfs
# * No need for rotation since all files are immutable
apt update
apt install -y pgxnclient
pgxn install pg_repack
#You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
apt install -y postgresql-server-dev-9.5
apt install -y ca-certificates
apt install -y build-essential
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 25, 2025 04:02
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Modern JavaScript: A (Brief) Overview

Lunch&Learn | 2019-03-26

What's new in modern JavaScript?

Modules

To make a module's (i.e. a script's) methods or variables useable by another module, export them:

@nileshsimaria
nileshsimaria / docker-default-directory
Last active September 24, 2024 05:33
Change docker's default /var/lib/docker to different directory on Ubuntu
1. Take a backup of docker.service file.
$ cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.orig
2. Modify /lib/systemd/system/docker.service to tell docker to use our own directory
instead of default /var/lib/docker. In this example, I am using /p/var/lib/docker
Apply below patch.
$ diff -uP -N /lib/systemd/system/docker.service.orig /lib/systemd/system/docker.service
--- /lib/systemd/system/docker.service.orig 2018-12-05 21:24:20.544852391 -0800
@gaearon
gaearon / modern_js.md
Last active April 14, 2025 19:22
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav