Skip to content

Instantly share code, notes, and snippets.

View harishletsgo's full-sized avatar

HP harishletsgo

  • 17:02 (UTC -04:00)
View GitHub Profile
@harishletsgo
harishletsgo / AdminInitiateAuthRequest.rs
Created December 19, 2020 11:42
Rust based AWS Cognito secret_hash function for rusoto_cogntio_idp to enable AdminInitiateAuthRequest
use sha2::Sha256;
use hmac::{Hmac, Mac, NewMac};
use openssl::base64;
let user = "username_here"
// Given that your .env is configured and you have initialized CognitoIdentityProviderClient
// and defined your "Auth Flow" to "ADMIN_NO_SRP_AUTH" which is currently not supported in rusoto_cognito_rdp
type HmacSha256 = Hmac<Sha256>;
@harishletsgo
harishletsgo / lambda.js
Created August 18, 2020 02:53 — forked from sammarks/lambda.js
Slack notifications from AWS Amplify
const https = require('https')
exports.handler = async (event) => {
const sns = event.Records[0].Sns.Message
let color = ''
let message = ''
if (sns.includes('build status is FAILED')) {
color = '#E52E59'
message = 'Release to My Company **production** failed.'
} else if (sns.includes('build status is SUCCEED')) {

Keybase proof

I hereby claim:

  • I am harishperfect on github.
  • I am harishprasanna (https://keybase.io/harishprasanna) on keybase.
  • I have a public key ASDv_YvipYXfNAuu3SaDFgFQD51o5cbEmqahPJZVsp6zZgo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1GByUnHoBktRPGa2oL33THpmSXyhPrV4UK https://explorer.blockstack.org/address/1GByUnHoBktRPGa2oL33THpmSXyhPrV4UK
@harishletsgo
harishletsgo / Yelp API oAuth 2.0 Python.py
Created October 21, 2016 08:07
Yelp APIv3 Fusion - oAuth 2.0 implementation
import re
import requests
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
#Fill app key details from Yelp
client_id = '<client id here>'
client_secret = '<client secret here>'
#Authenticate and get access token
// Matrix building -- Check the bottom for the matrix calling function
void BuildPerspProjMat(float *m, float fov, float aspect,
float znear, float zfar)
{
float ymax = znear * tan(fov * PI_OVER_360);
float ymin = -ymax;
float xmax = ymax * aspect;
float xmin = ymin * aspect;