Skip to content

Instantly share code, notes, and snippets.

View aalokt89's full-sized avatar

Aalok Trivedi aalokt89

View GitHub Profile
@aalokt89
aalokt89 / ImagePost.tsx
Last active June 16, 2019 18:09
Framer X Stack with design and code components
import * as React from "react";
import { Frame, Stack, PropertyControls, ControlType } from "framer";
import { Avatar, PostHeader, PostImage, PostButtonGroup } from "./canvas";
// Define type of property
interface Props {
username: string;
timeStamp: string;
postText: string;
width: number;
@aalokt89
aalokt89 / LayerComponent.tsx
Created August 26, 2018 18:36
Framer X Data and props Animation
import * as React from "react";
import {
Frame,
Data,
Animatable,
animate,
PropertyControls,
ControlType
} from "framer";
@aalokt89
aalokt89 / random user component
Last active September 27, 2018 16:55
get random user from randomuser.me api
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
import { UserCell } from "./canvas";
// Define type of property
interface Props {
width: number;
height: number;
gender: string;
}
@aalokt89
aalokt89 / dynamicButton.tsx
Created October 8, 2018 14:24
Dynamic Button Example
import * as React from 'react';
import { PropertyControls, ControlType } from 'framer';
import { NumberControlDescription } from 'framer/types/src/render';
// Define type of property
interface Props {
width: Number;
height: number;
label: string;
buttonType: string;
@aalokt89
aalokt89 / dynamicButtonState.tsx
Last active October 8, 2018 15:07
Dynamic Button with state
import * as React from 'react';
import { PropertyControls, ControlType } from 'framer';
import { NumberControlDescription } from 'framer/types/src/render';
// Define type of property
interface Props {
width: Number;
height: number;
label: string;
buttonType: string;
@aalokt89
aalokt89 / SectionButtonContainer.tsx
Last active May 13, 2019 18:46
Button Container Component: FramerX
import * as React from "react"
import {
Frame,
useCycle,
Stack,
addPropertyControls,
ControlType,
} from "framer"
import { SelectionButton } from "./SelectionButton"
import { colors } from "./colors"
@aalokt89
aalokt89 / Icon.tsx
Last active February 6, 2022 01:07
Framer x icon component
mport * as React from "react"
import { Frame, useCycle, addPropertyControls, ControlType } from "framer"
// Open Preview (CMD + P)
// API Reference: https://www.framer.com/api
interface Props {
iconName: string
tint: string
}
{
"BoxOffice2022": [
{
"PutRequest": {
"Item":{
"title":{
"S": "Top Gun: Maverick"
},
"release_date":{
"S": "11-12-2022"
import os
import datetime
import json
# convert time to human readable format
def convertDate(timestamp):
d = datetime.datetime.utcfromtimestamp(timestamp)
formatedDate = d.strftime('%b %d, %Y')
return formatedDate
@aalokt89
aalokt89 / stopInstanceByTag_lambda.py
Last active February 17, 2023 06:53
stops AWS EC2 instances by tag key/value and state
import boto3
import json
ec2 = boto3.resource('ec2', region_name='us-east-1')
def lambda_handler(event, context):
filteredInstances = []
successMessage = f"Successfully stopped {len(filteredInstances)} instances."