This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"keys": [ | |
{ | |
"use": "sig", | |
"kty": "RSA", | |
"n": "x0D1Vs1ZfkP3bHVU9XAV13dCICcmPKPX3-iH1oFV_HHQ5zdtlHpkfa5zdyrxD9ZkjZMuNSYLDe-be8G1co1oLkqrrOd6nz6NKRWvb1abH0CDxmafCCojYAbTvK5jMQo4SNsIQNwYbuyujoCJO3mQPQQ0gDezZXHJOquRb51XdYTfm4nuRVGuN3ipKoVH-jxIawApdkQ3wlvmrCbm6dqijTgQ9Ee1Pna24IPHot1pWvciYNOJi1uiGTmpzbq61h3XSA7Mci2EIlXFh3mGVaKZynXCsNw0ILWSe1O_3imgvXn2S15Kw4BegpyXP9G_RIpknA0VF0zCSpNO5sv82hQMzQ", | |
"e": "AQAB", | |
"kid": "BpUurJFrqamJLBwfLAXJ", | |
"alg": "RS256" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"keys": [ | |
{ | |
"kty": "RSA", | |
"e": "AQAB", | |
"use": "sig", | |
"kid": "1bb9605c36e98e30117a69517569386830202b2d", | |
"n": "pAbfKmQ1ljT6yZcrdxaJxqsB7EupbBFcCLiMzmuFQMuk3y_g-vVPR8ZwTJbalwBxD-vUPmxmZAVok_iNthw1mnW0POg3kEwtl1qambgNKlaTeO8S3D-KGlUNV6bU-JXbyquds7v8bQjmIQ5oXhwIQt6x55bEyZTOCQDl3ZHy1XxeBWFyiPUXXnqkO51EFeVNiMi8Ihue16UY_lIizhivl2C_UwJ0Ymx9eWJ-nefPBo7Lr_fIxh81NaLMB6t5L8123RSIaaIcR_r1H_ZbEe9VNTfnGdYS3A0u-pNS_bm5jRSBo1qt01OFu0xEsjcO7-NESTBr8w8SUqGK86tg9oQz5w", | |
"alg": "RS256" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ethers = require('ethers'); | |
var crypto = require('crypto'); | |
const generateAddress = async () => { | |
var id = crypto.randomBytes(32).toString('hex'); | |
const privateKey = "0x"+id; | |
console.log("SAVE BUT DO NOT SHARE THIS:", privateKey); | |
// for provider | |
const provider = new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/polygon_mumbai"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless Rails.env.test? | |
# SAMPLING_RATE = 0.10 | |
OpenTelemetry::SDK.configure do |c| | |
c.service_name = ENV.fetch('CLUSTER_NAME', "project-#{Rails.env}") | |
c.id_generator = OpenTelemetry::Propagator::XRay::IDGenerator | |
# The X-Ray Propagator injects the X-Ray Tracing Header into downstream calls | |
c.propagators = [OpenTelemetry::Propagator::XRay::TextMapPropagator.new] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener("fetch", (event) => { | |
event.respondWith(handleRequest(event)); | |
}); | |
async function handleRequest(event) { | |
const request = event.request; | |
// Block all methods except GET and HEAD | |
if (request.method === "GET" || request.method === "HEAD") { | |
let response = await serveAsset(event); | |
// Set error code if error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=$(git config user.email) | |
TOKEN=$(security find-generic-password -s github_token -w) | |
echo $USER | |
echo $TOKEN | |
echo 'Hi' | |
curl -s -u $USER:$TOKEN https://api.github.com/notifications \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update brew | |
brew update | |
# Upgrade all brew packages | |
brew upgrade | |
# Remove old versions of packages | |
brew cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell window 1 of app "google chrome" to close tabs whose id is not (get id of active tab) |
NewerOlder