Skip to content

Instantly share code, notes, and snippets.

View rafinskipg's full-sized avatar
🏠
Working from home

Venture rafinskipg

🏠
Working from home
  • web3
  • Worldwide
View GitHub Profile
@rafinskipg
rafinskipg / export.gs
Last active May 25, 2022 12:37
Export Tags MakerDAO Gov Polls
/**
* @OnlyCurrentDoc
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [
{name: "Export Tags", functionName: "exportSheet"},
{name: "Export Tag Definition", functionName: "exportTagDefinition"}
];

0x1709b2ce35876503e5af34cbfc2716d4fad2cb900d684bb14f1f84f3eeafb6fb

type FileNft = {
path: string,
name: string
}
export async function storeDirectory(files: FileNft[]) {
try {
const client = new NFTStorage({
token: process.env.NFT_STORAGE_KEY as string,
const description = "My nft is cool, this is the image number: 1"
const attributes = [{
trait_type: 'Hair',
value: 'None'
}]
const dataNft = await uploadNFTStorage(`./output/images/${items[i].tokenId}.png`, `${items[i].tokenId}`, description, attributes);
const info: TokenIpfs = {
name: 'Image 1',
type NftResponse = {
url: string,
ipnft: string,
ipfsImage: string,
hostedImage: string
}
export async function uploadNFTStorage(
path: string,
@rafinskipg
rafinskipg / client.ts
Created September 28, 2021 14:05
signing-security with web3
const web3 = new Web3(context.library.provider);
const thingToSave = {
message: 'Hello world',
owner: address,
};
const hashedData = web3.eth.accounts.hashMessage(
JSON.stringify(thingToSave)
);
@rafinskipg
rafinskipg / defaultservice.pro.yml
Created December 27, 2020 08:23
defaultservice.pro.yaml
name: Default Service - PRO
on:
push:
tags:
- v*
jobs:
deploy:
runs-on: ubuntu-latest
@rafinskipg
rafinskipg / server.js
Created October 7, 2020 07:08
webex oauth process
// This is the start of the flow, the CLIENT app redirects to this page
app.get('/api/auth/webex', (req, res) => {
// The webex_client_id is an environment variable extracted from the Create integration https://developer.webex.com/docs/integrations
// The scopes and redirect uri are also defined when creating the integration
// Remind to put there your domain url ex: myapp.com or localhost for development
// You will need to change also all the scopes query parameters of this url (you will get them from the "create integration process")
const authUrl = `https://webexapis.com/v1/authorize?client_id=${process.env.WEBEX_CLIENT_ID}&response_type=code&redirect_uri=${encodeURIComponent(process.env.BASE_URL)}%2Fapi%2Fauth%2Fwebex%2Fcallback&scope=meeting%3Arecordings_read%20spark%3Aall%20spark%3Akms%20meeting%3Aschedules_read%20meeting%3Apreferences_write%20meeting%3Arecordings_write%20meeting%3Apreferences_read%20meeting%3Aschedules_write&state=set_state_here`
// We do a redirect to the webex oauth U
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
let before = Date.now()
let dt = 0
const totalFigures = 50
const figures = []
function update(dt) {
const speed = 100 // We can have a different speed per square if we want
figures.forEach(figure => {
figure.x = figure.x + (dt * speed ) > canvas.width ? 0 : figure.x + (dt * speed)
})
}