Skip to content

Instantly share code, notes, and snippets.

View tinwritescode's full-sized avatar
🤒
Out sick

Tin Nguyen tinwritescode

🤒
Out sick
View GitHub Profile
async function voteObito() {
Logger.log("start wait")
Utilities.sleep(5000);
Logger.log("end wait")
const res = UrlFetchApp.fetch('https://api.wechoice.vn/Handler/SetVote.aspx?award=4&id=101&type=1', {
headers: {
cookie: '<replace here>',
referer: 'https://wechoice.vn/'

Documentation for getting started

Install pm2

npm install -g pm2

Open directory

CREATE TABLE Res_partner (
Id SERIAL PRIMARY KEY,
Name VARCHAR(255) NOT NULL,
Birthday DATE
);
CREATE TABLE Product_template (
Id SERIAL PRIMARY KEY,
Name VARCHAR(255) NOT NULL,
Uom_id INT,

Update database

This command will update the database with any changes made to the Prisma schema. It first runs the yarn install command, which will install any new packages added to the project. Then it runs npx prisma db push, which will apply the changes from the Prisma schema file to the actual database. This will ensure that the database is up to date with the latest changes.

yarn install
npx prisma db push
echo ">> Test 1: Storage deposit"
near call $FT_CONTRACT_NAME storage_deposit '{"account_id": "'$SOME_CONTRACT_NAME'", "registration_only": true}' --accountId $USER_NAME --amount 0.1

echo ">> Test 2: FT transfer call"
near call $FT_CONTRACT_NAME ft_transfer_call '{"receiver_id": "'$SOME_CONTRACT_NAME'", "amount": "10", "msg": "{\"kind\":0}"}' --depositYocto 1 --accountId $USER_NAME --gas 40000000000000
@tinwritescode
tinwritescode / esm-package.md
Created October 13, 2022 11:24 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from 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.
# create a new chain
iptables -N SAMPQUERY
# check that incomming packet is a samp query packet and divert to the new chain
# this inserts the rule as the first in the chain, but should probably be a bit further down (e.g. after checking lo interface)
iptables -I INPUT -p udp \! -f -m udp --dport 7777 -m conntrack --ctstate NEW,ESTABLISHED -m u32 --u32 "0x0>>0x16&0x3c@0x8=0x53414d50" -j SAMPQUERY
# only allow connection from ephemeral source ports
# connection attempts from ports outside this range are likely rogue clients
iptables -A SAMPQUERY -p udp --sport 49152:65535 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
{"exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException", "file": "/var/www/actions-plats/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php", "line": 44, "message": "", "trace": [{"class": "Illuminate\\Routing\\AbstractRouteCollection", "file": "/var/www/actions-plats/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php", "function": "handleMatchedRoute", "line": 162, "type": "->"}, {"class": "Illuminate\\Routing\\RouteCollection", "file": "/var/www/actions-plats/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "function": "match", "line": 680, "type": "->"}, {"class": "Illuminate\\Routing\\Router", "file": "/var/www/actions-plats/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "function": "findRoute", "line": 667, "type": "->"}, {"class": "Illuminate\\Routing\\Router", "file": "/var/www/actions-plats/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "function": "dispatchToRoute", "line": 656, "type": "->"}, {
> Task :lottie-react-native:androidJavadocs FAILED
/home/trungtin/Coding/plats-mobile/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java:8: error: package androidx.core.view does not exist
import androidx.core.view.ViewCompat;
^
/home/trungtin/Coding/plats-mobile/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java:13: error: package com.airbnb.lottie does not exist
import com.airbnb.lottie.LottieAnimationView;
^
/home/trungtin/Coding/plats-mobile/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java:14: error: package com.airbnb.lottie does not exist
import com.airbnb.lottie.RenderMode;
^
import React, {Component} from 'react';
import {StyleSheet, Platform, ToastAndroid} from 'react-native';
import {
ViroImage,
ViroNode,
ViroARScene,
ViroText,
ViroConstants,
ViroARSceneNavigator,
ViroFlexView,