Skip to content

Instantly share code, notes, and snippets.

@mmansoor
mmansoor / readme.md
Last active June 14, 2024 07:46
Export Metrics from CloudWatch to CSV

Export CloudWatch Metrics

This document outlines how to export CloudWatch Metrics to CSV.

Pre Reqs

  1. AWS CLI (Command Line Interface) from here
  2. jq is a lightweight and flexible command-line JSON processor from here

How to export

@kmikiy
kmikiy / crypto.gs
Last active June 16, 2022 12:17
Google Sheets Apps Script for fetching latest crypto price from Binance
function BINANCE_PRICE(coinsymbol, pair) {
var url = "https://api.binance.com/api/v3/ticker/price?symbol="+coinsymbol.toUpperCase()+pair.toUpperCase()
var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});
var json = response.getContentText();
var data = JSON.parse(json);
return data.price
}
/*
@glebkuznetsov
glebkuznetsov / query-crypto-price-apps-script.js
Created January 15, 2018 01:31
Google Apps Script to query crypto prices from cryptocompare.com API
function updateAssetPrices(sheetTab) {
var currency = sheetTab.getRange('J1').getValue();
var response = UrlFetchApp.fetch(
'https://min-api.cryptocompare.com/data/price?fsym=' + currency + '&tsyms=USD')
var jsonData = response.getContentText();
var data = JSON.parse(jsonData);
sheetTab.getRange('J2').setValue(data.USD);
sheetTab.getRange('J3').setValue(
Utilities.formatDate(new Date(), "EST", "yyyy-MM-dd'T'HH:mm:ss'Z'"));
}
@tanaikech
tanaikech / submit.md
Last active January 14, 2023 19:32
Binance API for Google Apps Script

Binance API for Google Apps Script

This sample script is for using Binance API by Google Apps Script. This script encryptes "signature" like samples. In this script, "Example 1: As a query string" is used, and it retrieves "All orders (SIGNED)" by "GET".

function main() {
    var key = '#####'; // Please input your key.
    var secret = '#####'; // Please input your secret.
    var api = "/api/v3/allOrders"; // Please input API Endpoint you want.
    var timestamp = Number(new Date().getTime()).toFixed(0);
 var string = "symbol=LTCBTC&timestamp=" + timestamp; // Please input query parameters for the inputterd API.
@agentcooper
agentcooper / 0.README.md
Last active March 18, 2026 17:02
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream