Skip to content

Instantly share code, notes, and snippets.

View Translucent504's full-sized avatar

Shayaan Ahmed Farooqi Translucent504

View GitHub Profile
@Translucent504
Translucent504 / GoogleAuth.java
Created March 27, 2022 20:26
refreshing capacitor google signin android
package com.codetrixstudio.capacitor.GoogleAuth;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerFuture;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import androidx.activity.result.ActivityResult;
@Translucent504
Translucent504 / GetItem.vtl
Last active February 3, 2021 09:25
Snippet for Basic GetItem Query VTL
`{
"version": "2017-02-28",
"operation": "GetItem",
"key": {
"pk": $util.dynamodb.toDynamoDBJson($ctx.args.devId),
"sk": $util.dynamodb.toDynamoDBJson("A")
}
}`
@Translucent504
Translucent504 / tanzeel.ts
Created January 1, 2021 07:41
Cloudfront S3 solutions construct example usage.
import * as cdk from "@aws-cdk/core";
import * as s3deploy from "@aws-cdk/aws-s3-deployment";
import {
CloudFrontToS3,
CloudFrontToS3Props,
} from "@aws-solutions-constructs/aws-cloudfront-s3";
import { Bucket } from "@aws-cdk/aws-s3";
export class TanzeelStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
@Translucent504
Translucent504 / appsync-apolloclient.js
Created November 18, 2020 07:56
Snippet to be able to use AWS Appsync GraphQL backend with Apolloclient on the frontend with hooks etc.
// This is just a slightly modified version of the post here: https://medium.com/@guillac124/create-your-custom-apollo-client-for-aws-appsync-to-use-hooks-2d5cbce29db5
import fetch from "cross-fetch"
import {
ApolloClient,
InMemoryCache,
ApolloLink,
createHttpLink,
} from "@apollo/client"
import { createAuthLink } from "aws-appsync-auth-link"
import AppSyncConfig from "../../aws-exports"
@Translucent504
Translucent504 / gist:1dcdbc7df6365c85b70ec418c14e4e51
Created February 25, 2019 18:59
Tablewidget cells question
from PySide2 import QtWidgets, QtGui,QtCore
import sys
class MyCell(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.top = 'NOT SET'
self.bot = 'NOT SET'
layout = QtWidgets.QVBoxLayout()
top = QtWidgets.QLineEdit()