Skip to content

Instantly share code, notes, and snippets.

View JingwenTian's full-sized avatar
🎯
Focusing

JingwenTian JingwenTian

🎯
Focusing
View GitHub Profile
@saarim-mirror
saarim-mirror / arweave-query.gql
Created April 4, 2022 19:20
Query for Mirror Content on Arweave
// GraphQL query to get the Arweave transaction ID of a Mirror post
// With the transaction ID we can use `getData()` from the Arweave JS SDK, eg.
// arweave.transactions.getData('bNbA3TEQVL60xlgCcqdz4ZPHFZ711cZ3hmkpGttDt_U').then(data => { console.log(data); });
// We can use the explorer at https://arweave.net/graphql, which queries https://arweave.net/graphql to test it out
// With the transaction ID we can go to the URL `arweave.net/<YOUR_TRANSACTION_ID>` which will render the JSON
// More details on how this works on https://dev.mirror.xyz/GjssNdA6XK7VYynkvwDem3KYwPACSU9nDWpR5rei3hw
query GetMirrorTransactions($digest: String!) {
transactions(tags:[
@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@TheLoneRonin
TheLoneRonin / ARWEAVE.GQL.MD
Last active December 11, 2023 13:18
Arweave Query Guide

Arweave GraphQL Guide

Retrieving Data

In order to retrieve data from Arweave, you can use the following example query to retrieve the entire transaction output.

query {
    transactions {
        cursor
// Note that this is not the production code
pragma solidity 0.5.6;
import "./IERC20.sol";
contract Wallet {
address internal token = 0x123...<hot_wallet_addr>;
address internal hotWallet = 0x321...<hot_wallet_addr>;
constructor() public {
@zhuziyi1989
zhuziyi1989 / URL Schemes.md
Last active November 14, 2024 06:45
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些 URL Schemes 已失效,可在评论区留言指出!(最后更新于 2024.10.28)

关于 URL Scheme 你知道多少?

iOS 系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在 APP 之间跳转的方法:URL Scheme。简单的说,URL Scheme 就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的 URL Scheme 都是不一样的,如果存在一样的 URL Scheme,那么系统就会响应先安装那个 APP 的 URL Scheme,因为后安装的 APP 的 URL Scheme 被覆盖掉了,是不能被调用的。

Android 系统中

@virgilwashere
virgilwashere / _Mautic_nginx_config_files.md
Last active February 17, 2024 02:28 — forked from magnetikonline/README.md
Mautic nginx config files
@shasharoman
shasharoman / queue-core.js
Created June 25, 2018 10:04
core redis-queue logic
const Promise = require('bluebird');
const _ = require('lodash');
const uuid = require('uuid');
const C = require('../constant');
const proxy = require('../proxy');
const lib = require(process.env.lib);
const redis = lib.redis.createClient(C.QUEUE.REDIS);
const logger = lib.logger.createLogger('common-service-queue');
exports.pushTask = pushTask;
@dideler
dideler / bot.rb
Last active November 9, 2024 11:37
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@holmberd
holmberd / php-pools.md
Last active September 25, 2024 05:44
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)