Skip to content

Instantly share code, notes, and snippets.

View shivkanthb's full-sized avatar
🧃
sippin' n shippin'

Shivkanth Bagavathy shivkanthb

🧃
sippin' n shippin'
View GitHub Profile
@dabit3
dabit3 / react-native-walletconnectmodal.js
Last active October 6, 2023 03:02
React Native WalletConnectModal Example
/*
* Resources
* Medium: https://medium.com/walletconnect/how-to-build-a-react-native-dapp-with-walletconnect-28f08f332ed7
* YouTube: https://www.youtube.com/watch?v=mGtEPQfqMV8
* Docs: https://docs.walletconnect.com/2.0/advanced/walletconnectmodal/about?platform=react-native
*/
import { WalletConnectModal, useWalletConnectModal } from "@walletconnect/modal-react-native"
import { StyleSheet, Text, View, TouchableHighlight } from "react-native"
const projectId = 'my-project-id' // see https://cloud.walletconnect.com/
@tchayen
tchayen / main.js
Last active September 5, 2021 08:54
/**
* Usage:
* 1. Paste this into a main.js file in some empty directory.
* 2. Run: `yarn add web3 ethers abi-decoder`.
* 3. Go to contract's page
* https://etherscan.io/address/0x25ed58c027921E14D86380eA2646E3a1B5C55A8b
* and then to code and then copy "Contract ABI" and save it in the same dir
* as abi.json.
* 4. Create empty file backup.txt.
* 5. Download CSV data with transactions from etherscan page and save as
@tokland
tokland / puppeteer-click-by-text.js
Last active August 11, 2023 03:48
Click link by text in Puppeteer
const puppeteer = require('puppeteer');
const escapeXpathString = str => {
const splitedQuotes = str.replace(/'/g, `', "'", '`);
return `concat('${splitedQuotes}', '')`;
};
const clickByText = async (page, text) => {
const escapedText = escapeXpathString(text);
const linkHandlers = await page.$x(`//a[contains(text(), ${escapedText})]`);
@enricofoltran
enricofoltran / main.go
Last active April 6, 2025 09:48
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
function dots(width, height, density) {
for (let i = 0; i < density; i += 1) {
createDot(
Math.floor(Math.random() * width),
Math.floor(Math.random() * height),
);
}
}
function createDot(x, y) {
@slvnperron
slvnperron / HOWTO.md
Last active March 30, 2017 21:55
Enable demo-mode for Messenger bots | Botpress Engineering Hacks 👉 https://botpress.io

Messenger Demo Mode (Chrome)

This script removes the left panel on messenger (your other conversations).

This is useful if you want to test a messenger bot distraction-free or doing a demo of your bot.

1. Install the Injector Chrome Extension

2. Configure Injector

@rbrigden
rbrigden / startupy_domains.txt
Last active June 7, 2024 05:09
Every english word that is currently available for registration as a full domain (TLD included).
abdominocardi.ac
autotr.actor
cephalotr.actor
cocontr.actor
coen.actor
cornf.actor
counter.actor
effr.actor
idemf.actor
lithofr.actor
@rpaul-stripe
rpaul-stripe / app.js
Last active July 11, 2020 01:40
Stripe Checkout Node.js Express Example
const keyPublishable = process.env.PUBLISHABLE_KEY;
const keySecret = process.env.SECRET_KEY;
const app = require("express")();
const stripe = require("stripe")(keySecret);
app.set("view engine", "pug");
app.use(require("body-parser").urlencoded({extended: false}));
app.get("/", (req, res) =>
@JuanJo4
JuanJo4 / app.js
Last active September 26, 2020 21:53
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@devStepsize
devStepsize / botkit_slackbutton_incomingwebhooks.js
Created April 22, 2016 19:24
Botkit example of using the Slack Button to offer an incoming webhook integration (from https://github.com/howdyai/botkit/blob/master/examples/slackbutton_incomingwebhooks.js)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______ ______ ______ __ __ __ ______
/\ == \ /\ __ \ /\__ _\ /\ \/ / /\ \ /\__ _\
\ \ __< \ \ \/\ \ \/_/\ \/ \ \ _"-. \ \ \ \/_/\ \/
\ \_____\ \ \_____\ \ \_\ \ \_\ \_\ \ \_\ \ \_\
\/_____/ \/_____/ \/_/ \/_/\/_/ \/_/ \/_/
This is a sample Slack Button application that allows the application
to post messages into Slack.
This bot demonstrates many of the core features of Botkit: