Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Venture rafinskipg

🏠
Working from home
  • web3
  • Worldwide
View GitHub Profile
@rafinskipg
rafinskipg / export.gs
Last active May 25, 2022
Export Tags MakerDAO Gov Polls
View export.gs
/**
* @OnlyCurrentDoc
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [
{name: "Export Tags", functionName: "exportSheet"},
{name: "Export Tag Definition", functionName: "exportTagDefinition"}
];
View upload_directory.ts
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,
View save_json.ts
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',
View uploadfile.ts
type NftResponse = {
url: string,
ipnft: string,
ipfsImage: string,
hostedImage: string
}
export async function uploadNFTStorage(
path: string,
@rafinskipg
rafinskipg / client.ts
Created Sep 28, 2021
signing-security with web3
View client.ts
const web3 = new Web3(context.library.provider);
const thingToSave = {
message: 'Hello world',
owner: address,
};
const hashedData = web3.eth.accounts.hashMessage(
JSON.stringify(thingToSave)
);
View defaultservice.pro.yml
name: Default Service - PRO
on:
push:
tags:
- v*
jobs:
deploy:
runs-on: ubuntu-latest
@rafinskipg
rafinskipg / server.js
Created Oct 7, 2020
webex oauth process
View server.js
// 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
View full-example-etereo-animation.js
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
let before = Date.now()
let dt = 0
const totalFigures = 50
const figures = []
View update.js
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)
})
}