Skip to content

Instantly share code, notes, and snippets.

View supercede's full-sized avatar
🎯

Ade supercede

🎯
  • Tallinn
View GitHub Profile

API Documentation

Routes are prefixed with /api

Authentication

Get JWT Token

Endpoint: GET /auth/:telegramId

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20; // declare the version of solidity to compile this contract. This must match the version of solidity in your hardhat.config.js file
// add ownable and ERC721.sol
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@supercede
supercede / script.sh
Last active August 2, 2022 14:04
AWS Cloudformation User Data script in install nodejs, pm2, codedeploy agent and set env variables from AWS parameter store (or AWS secrets manager if you tweak the aws command). AWS Parameter Store uses parameter hierarchies to organize and manage parameter access in an easier manner.
UserData:
"Fn::Base64": !Sub |
#!/bin/bash
yum install ruby -y
wget https://aws-codedeploy-${AWS::Region}.s3.${AWS::Region}.amazonaws.com/latest/install
chmod +x ./install
./install auto
cd /tmp
yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
systemctl enable amazon-ssm-agent
@supercede
supercede / index.js
Last active September 25, 2021 19:10
Tracking Errors in Apollo GraphQL with Sentry
require('dotenv').config();
const { ApolloServer } = require('apollo-server');
const Sentry = require('@sentry/node');
const { makeExecutableSchema } = require('@graphql-tools/schema');
const typeDefs = require('./src/graphql/typedefs');
const resolvers = require('./src/graphql/resolvers');
const schema = makeExecutableSchema({
typeDefs,
resolvers,
const express = require('express');
const axios = require('axios').default;
const { client, getAsync } = require('./redis');
const app = express();
app.get('/countries', async (request, response) => {
try {
const redisKey = 'COUNTRIES';
const countries = await getAsync(redisKey);
import http from "http";
import debug from "debug";
import { config } from "dotenv";
import app from "./app";
config();
const DEBUG = debug("dev");
const PORT = process.env.PORT || 5000;
// Go tour equivalent binary tree solution
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
// Walk walks the tree t sending all values
// Line 138 (Update book)
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"