Skip to content

Instantly share code, notes, and snippets.

View shrshk's full-sized avatar
Focusing

Shirish Veerabattini shrshk

Focusing
View GitHub Profile
@jorenvandeweyer
jorenvandeweyer / tesla-oauth-v3.ts
Created January 31, 2021 12:29
NodeJS (TS) Implementation for /oauth2/v3 (with optional MFA)
/* eslint-disable camelcase */
import axios, { AxiosInstance, AxiosResponse } from 'axios'
import crypto from 'crypto'
import qs from 'querystring'
import URLSafeBase64 from 'urlsafe-base64'
import cryptoRandomString from 'crypto-random-string'
import { Cookie, CookieJar } from 'tough-cookie'
import { EventEmitter } from 'events'
interface OAuthParameters {
predict = (
data,
a = 0.95,
b = 0.4,
g = 0.2,
p = this.PERIODS_TO_PREDICT,
) => {
const alpha = a;
const beta = b;
const gamma = g;
@maxkostinevich
maxkostinevich / dev.yml
Last active March 12, 2024 17:18
Github Actions - Deploy Serverless Framework (AWS)
#
# Github Actions for Serverless Framework
#
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
#
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
#
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/
#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@serjKim
serjKim / gist:7f453992211637731d2f4d762c60f7a5
Last active July 6, 2022 21:43
integrate expo to the existing project
  1. add app.json, set the newest sdkVersion
{
  "name": "<yourname>",
  "displayName": "<yourname>",
  "expo": {
    "sdkVersion": "25.0.0"
  }
}
@bellbind
bellbind / main.js
Last active April 27, 2024 04:12
[electron] Tray launcher example
"use strict";
// [run the app]
// $ npm install electron
// $ ./node_modules/.bin/electron .
const {app, nativeImage, Tray, Menu, BrowserWindow} = require("electron");
let top = {}; // prevent gc to keep windows
@patpohler
patpohler / Big List of Real Estate APIs.md
Last active May 16, 2024 15:41
Evolving list of Real Estate APIs by Category

Big List of Real Estate APIs

Listings / Property Data

####Rets Rabbit http://www.retsrabbit.com

Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.

@brandongoode
brandongoode / comment-example.js
Created August 11, 2016 13:16
Dynamoose range and hash key example
var commentSchema = new Schema({
postId: {
type: String,
hashKey: true
},
id: {
type: String,
rangeKey: true,
default: shortId.generate
@magegu
magegu / multipart.js
Last active July 11, 2023 20:12
mutipart upload for aws s3 with nodejs based on the async lib including retries for part uploads
/*
by Martin Güther @magegu
just call it:
uploadFile(absoluteFilePath, callback);
*/
var path = require('path');
var async = require('async');
@sevastos
sevastos / aws-multipartUpload.js
Last active October 8, 2023 10:43
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;